

Simply include the Ke圜odes.bas, StrFuncs.bas, and MD5_Crypt.bas files into your project. We do ask that if you make any changes to the key generation code itself that you release the code under the same terms as you received it.Īdditionally, this code provides some useful string functions to encode/decode binary values encoded in a string to Base32 and to bitwise left and right shift these values by an arbitrary number of bits. Please note that all code in this article is licensed under the LGPL, so it can be incorporated into your programs with no royalties and doesn't modify the licensing terms of your proprietary code in any way. It can even be used in VBA applications such as Microsoft Access if desired. and is presented in as "generic" of a Visual Basic form as possible to permit easy integration into applications. The code is pretty straight-forward for the most part, and can be easily translated into other languages such as C, C++, C#, Java, etc. This is easier for end-users to type and looks better and more professional as well. We then convert the hexadecimal 32-character string to Base32 to shorten the resulting key down to 26 characters. The keys generated by the sample application are MD5 hashes of a "Licensee" name, a "Serial Number, and a "secret" program name string that is embedded into the code. The code presented here provides an easy way to integrate this functionality into your own programs. These keys are normally based on various encryption schemes, and serve to validate that a particular user is authorized to install or run the software.

BackgroundĮveryone is familiar with getting license keys to activate software.

This code is flexible and may be used in many different licensing schemes. Create and validate secure "License Keys" for your proprietary code and embed up to 16-bits of "configuration data" into the key.
