Skip to main content
deleted 33 characters in body; edited tags
Source Link

I need a serial number generator and accompanying checker. I would like to be able to set a salt (and maybe a length). The generator should only produce serial numbers that pass the test of the checker. Those numbers should only account for a small fraction of all the possible numbers of the given length.

The algorithm needn't be cryptographically secure. Rather, it should be very easy to implement (in javascript) and it should be very fast.

Thanks in advance.

EDITTo clarify: Clarification

If you buy commercial software, it is sometimes protected with a serial number/a key. If you type it in, the software verifies it algorithmically (by checking whether it fulfills certain properties), rather than looking up a huge database. I'm also pretty sure that the keys were all generated algorithmically rather than by hand. And only a small fraction of all the possible keys of a given length are actually valid so it's hard to guess keys.

Salt: I don't know whether salt is the right word, but the algorithm should have at least one parameter, whose choice alters the generated keys (so that multiple people can use the same algorithm and needn't fear collisions).

I need a serial number generator and accompanying checker. I would like to be able to set a salt (and maybe a length). The generator should only produce serial numbers that pass the test of the checker. Those numbers should only account for a small fraction of all the possible numbers of the given length.

The algorithm needn't be cryptographically secure. Rather, it should be very easy to implement (in javascript) and it should be very fast.

Thanks in advance.

EDIT: Clarification

If you buy commercial software, it is sometimes protected with a serial number/a key. If you type it in, the software verifies it algorithmically (by checking whether it fulfills certain properties), rather than looking up a huge database. I'm also pretty sure that the keys were all generated algorithmically rather than by hand. And only a small fraction of all the possible keys of a given length are actually valid so it's hard to guess keys.

Salt: I don't know whether salt is the right word, but the algorithm should have at least one parameter, whose choice alters the generated keys (so that multiple people can use the same algorithm and needn't fear collisions).

I need a serial number generator and accompanying checker. I would like to be able to set a salt (and maybe a length). The generator should only produce serial numbers that pass the test of the checker. Those numbers should only account for a small fraction of all the possible numbers of the given length.

The algorithm needn't be cryptographically secure. Rather, it should be very easy to implement (in javascript) and it should be very fast.

To clarify: If you buy commercial software, it is sometimes protected with a serial number/a key. If you type it in, the software verifies it algorithmically (by checking whether it fulfills certain properties), rather than looking up a huge database. I'm also pretty sure that the keys were all generated algorithmically rather than by hand. And only a small fraction of all the possible keys of a given length are actually valid so it's hard to guess keys.

Salt: I don't know whether salt is the right word, but the algorithm should have at least one parameter, whose choice alters the generated keys (so that multiple people can use the same algorithm and needn't fear collisions).

edited tags
Link
Thomas Pornin
  • 330k
  • 61
  • 803
  • 973
Note license in title - not really about key management - signatures; edited title
Link
nealmcb
  • 21k
  • 6
  • 74
  • 118

License key / Serial number generator and checker

Tweeted twitter.com/#!/StackSecurity/status/47617618433150976
added 721 characters in body
Source Link
Dave
  • 261
  • 1
  • 2
  • 6
Loading
edited tags
Link
AviD
  • 73.9k
  • 25
  • 144
  • 224
Loading
Source Link
Dave
  • 261
  • 1
  • 2
  • 6
Loading