I have this idea of implementing a license key:
- After the user downloads the program, he connects to a website and sends his Windows product ID.
- The website, then, sends this back to him with a signature using a private RSA key.
- The program, then, checks, using a public key, whether it is really signed by the private key, and stores this message it got.
Now, every time the program starts, it retrieves this message, and checks it in the way mentioned in 3., comparing that with the windows product ID retrieved from the operating system.
This is done using 1024 bit numbers. I can't encode anything with the private key using what the computer language (C#) offers. (I don't want to implement my own algorithm – I don't know enough about encryption.)
Is the Windows product key long enough for this? It's something like 12345-abc-1234567-12345
. (Get it by right-clicking on “my-computer”, and clicking “properties”.)
I apologize for my non-cryptographer way of asking. Here are the questions:
a) Is encrypting a small number by a large key safe?
b) Is signing a message (as opposed to encrypting it) safe?