Creating Product Keys using Cryptography
If you want to protect your application using a product key or serial number in the common scheme of ABCDE-FGHIJ-KLMNO-PQRST but don't want to use any of the commercially available solutions, you may find these two articles at codeproject.com useful:
Both articles are written by Jeffrey Walton.
2007-03-15 Edit: corrected the link to the AES artilce - thanks to Christoph Voigt