I want design a product key using RSA key but I don’t know if my idea is secure.
my idea for design product key:
I have a pair key
for example
public key is :
MIIBvTCCASYCCQD55fNzc0WF7TANBgkqhkiG9w0BAQUFADAjMQswCQYDVQQG…
private key is :
MIICWwIBAAKBgQDRhGF7X4A0ZVlEg594WmODVVUIiiPQs04aLmvfg8SborHss5gQ…
I create product key like this:
(begin of private key for eaxmple) MIICWwIBAAKBgQDRh
And remove it from private key in software
When user doesn’t have a product key cannot decode key
That’s not how you should use Public/Private keys for a product key.
Better Implementation
You can create a XML Document describing the features that are enabled. Or just something simple with the Customer Name and Date.
You use the private key to sign the the XML document and store the hash and signature with the document. You can then verify the XML document in your product using the Public key you generated earlier.
Result of signing the document:
If the user changes the contents of the license file then the signature will no longer match. They will also not be able to re-sign the document because they do not have access to your private key. This is important, you ship the PUBLIC key with your product not the private key.
Short Key Implementation
It will look like 1234-1234-1234-1234
C# Solution: