license key verification in C#
-
Thursday, June 09, 2011 6:26 AM
hi all
i am working with desktop application
when i install my setup one license key is required for this setup
i am randomly generating this 16 character license key
can you tell how to verify this at the time of installation
i want such type of code to verify this key
or whole code how to generate this license key and verify this key
please help me its urgent
thanks in advance
i am waiting for your valuable help
All Replies
-
Wednesday, June 08, 2011 5:59 AM
hi,
i am working on desktop application
i want such type of algorithm which is use to validate any key that is enterd by user when he install the setup
when we install my setup this setup want a license key this is entered into four textboxes each textbox can have four character means length of key will be 16 now i want to validate this key
first i am converting this 16 character key into binary no
i want such type of algo that return same result for every key
jukt like that first license key convert into binary form this binary form pass this algo abd this algo return zero or any thing else whatever you want
and sum or multiplication or division
- Merged by Helen ZhouModerator Thursday, June 09, 2011 9:25 AM duplicated
-
Wednesday, June 08, 2011 8:51 AM
Dim SerialNumber = Guid.NewGuid
Var SerialNumber = Guid.NewGuid();
Try this next time in the forum for the program language you are using.
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral
This is a forum for the System.Windows.Forms namespace and related questions for that but at least containing elements of that namespace.
Be aware some use this namespace also with C++ managed or F#
Success
Cor
-
Thursday, June 09, 2011 7:30 AM
http://www.codeproject.com/KB/security/cdkeys.aspx
http://www.codeproject.com/KB/install/LicenseKeyGeneration.aspx
http://www.codeproject.com/KB/install/VB_KeyCode.aspx
Kindly have a look at the samples provided in the above link
Regards,
Narendran Ponpandiyan
-
Thursday, June 09, 2011 9:02 AM
You would find apt answer in another thread
http://social.msdn.microsoft.com/forums/en-us/winforms/thread/9B8F74F2-290A-4AEF-AE1E-12E430263B82
Hope this helps.
Please mark this as "Answer" or "Vote as helpful" if it has resolved your issue/question/problem.- Proposed As Answer by Vishvvas Thursday, June 09, 2011 9:03 AM
- Marked As Answer by Mike Dos ZhangMicrosoft Contingent Staff, Moderator Thursday, June 16, 2011 8:52 AM
-
Monday, June 13, 2011 10:37 AMModerator
If you use Visual Studio Setup and Deployment projects, you might already know that it is not very good for creating really smart setups we often need. I'd like to share two alternative ways to create installers within Visual Studio IDE:
+ Lexpa - Inno Setup integration for Visual Studio [http://www.lexpa.com]. Creates small and fast installers.
+ Votive - WiX toolset integration for Visual Studio [http://wix.sourceforge.net/votive.html]. Creates MSI-based installers.
Both add special project type to VS Add New Project dialog and allow you to create setup of any level of difficulty.
Or:
http://www.oreans.com/winlicense.php
http://www.interactive-studios.net/products/qlm.htm
http://stackoverflow.com/questions/453030/how-can-i-create-a-product-key-for-my-c-app
You can do something like create a record which contains the data you want to authenticate to the application. This could include anything you want - e.g. program features to enable, expiry date, name of the user (if you want to bind it to a user). Then encrypt that using some crypto algorithm with a fixed key or hash it. Then you just verify it within your program. One way to distribute the license file (on windows) is to provide it as a file which updates the registry (saves the user having to type it).
Beware of false sense of security though - sooner or later someone will simply patch your program to skip that check, and distribute the patched version. Or, they will work out a key that passes all checks and distribute that, or backdate the clock, etc. It doesn't matter how convoluted you make your scheme, anything you do for this will ultimately be security through obscurity and they will always be able to this. Even if they can't someone will, and will distribute the hacked version. Same applies even if you supply a dongle - if someone wants to, they can patch out the check for that too. Digitally signing your code won't help, they can remove that signature, or resign it.
You can complicate matters a bit by using techniques to prevent the program running in a debugger etc, but even this is not bullet proof. So you should just make it difficult enough that an honest user will not forget to pay. Also be very careful that your scheme does not become obtrusive to paying users - it's better to have some ripped off copies than for your paying customers not to be able to use what they have paid for.
Another option is to have an online check - just provide the user with a unique ID, and check online as to what capabilities that ID should have, and cache it for some period. All the same caveats apply though - people can get round anything like this.
Consider also the support costs of having to deal with users who have forgotten their key, etc.
Or you can try Shareware Starter Kit:
http://blogs.msdn.com/b/danielfe/archive/2005/07/10/437293.aspx
Or the Serial Key Maker:
http://www.serialkeymaker.com/how_to_implement_serial_key_maker.aspx
There're also several links would be helpful to you:
http://www.debugging.com/bug/16115
http://www.codeproject.com/Answers/159167/csharp-Setup-for-Trial-and-Serial-key.aspx#answer3
http://www.codeproject.com/KB/install/LicenseKeyGeneration.aspx
http://www.emoreau.com/Entries/Articles/2007/12/Licensing-a-VBNet-application.aspx
As I mentioned, visual studio built in deployment technical is not suitable for you to request a smart installation package. And the option is according the above information to use others product, rather than research the setup project option.
Or if you also want to do this hard work with visual studio setup project or yourself, you can ref the following several articles:
http://helpful-tech-how-to-tips.blogspot.com/2010/05/how-to-validate-serial-number-during.html
http://www.codeproject.com/KB/security/NbbfArchitecture.aspx
incorporating-license-key-approach-for-a-winforms-app
algorithm-for-unique-cd-key-generation-with-validation
how-to-generate-and-validate-a-software-license-key
Crypto Primer: Understanding encryption, public/private key, signatures and certificates
And for other deployment solution(exclude the visual studio setup project and ClickOnce), you can go to their special forum for more expert help to help you achieve your goal easier.
You can find most of the deployment solution products and their website(forums) form this url:
http://installsite.org/pages/en/msi/authoring.htm
For more discussions on this topic, you also can ref the following thread saying:
http://social.msdn.microsoft.com/Forums/zh/winformssetup/thread/301913a0-ecf9-4095-8d66-a3f4baeea6eb
Or the easier way is put the validate processes in the application start proceeds, then you can ensure the key every time or the first time you boot the application.
Mike [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
- Marked As Answer by Mike Dos ZhangMicrosoft Contingent Staff, Moderator Thursday, June 16, 2011 8:52 AM
-
Friday, December 02, 2011 3:02 AMAren't you actually associated with SoftActivate, Catalin?


