Create a reasonable license key size with asymmetric encryption?

I look at it all day. I probably should have left him a few hours ago; At the moment, I may miss something obvious.

Short version: Is there a way to generate and weld an asymmetrically encrypted hash with a reasonable number of unique, readable characters?

Long version:

I want to create license keys for my software. I would like these keys to have a reasonable length (25-36 characters) and be easy to read and enter by a person (so avoid ambiguous characters such as the number 0 and the capital letter O).

Finally - and this seems to be a kicker - I would really like to use asymmetric encryption to make it difficult to create new keys.

I have a general approach: combine my information (username, product version, salt) into a string and generate the SHA1 () hash, and then encrypt the hash using my private key. On the client, create a SHA1 () hash from the same information, then decrypt the license using the public key and see if I have a match.

Since this is a Mac application, I looked at AquaticPrime, but it generates a relatively large license file, not a string. I can work with this if necessary, but as a user I really like the convenience of a license key, which I can read and print.

I also looked at CocoaFob, which generates a key, but it is so long that I would like to deliver it as a file anyway.

I cheated on OpenSSL for a while, but couldn't come up with anything of reasonable length.

... - ? , ?

. , - . , , .

, !

PS - , , . - , , , .

+5
5

, . , .

, , :

  • base32. , . (0vsO ..).
  • DSA, , RSA.
  • (, sha1 md5 ) .
+1

MD5. 32- - . SHA1-, , .

0

SHA1 hex, , ( ), 0-9A-F, AP , "" , MD5 32 SHA1. / SHA1/MD5 .

0

, , . , , , - ( , - ..), , /, .

, , ( !), , .

0

Boneh-Lynn-Shacham, ( ) .

generic openssl bash:

openssl ecparam -genkey -name sect113r1 -out private.key # generate the private key (store it on your server)
openssl ec hist-in private.key -pubout -out public.key # generate a public key (store it in the client software)
# generate a random one time activation userID or a hardware-based one here (CLIENT SIDE)
user_id="unique_on_the_fly_generated_user_ID" # send the user ID to the server for license generation
signature=""
return_value=0
while [[ $return_value == 0 ]]
do
    signature=$(echo "$user_id" | openssl dgst -sign private.key | base64 > signature.txt) # generate a user licence
    echo "$signature" | egrep -q 'O|l|/|\+|=' # check for ambiguous chars
    return_value=$?
done
echo "$signature" | base64 -d > signature.txt # send the signature/license to the client
openssl dgst -verify public.key -signature signature.txt # verify signature (CLIENT SIDE)

, / 48 ( "M" char, ). , openssl .

0

All Articles