Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I generate a serial number (registration number)?

How can I generate a serial number users can use to register an application?

I was thinking to the following scenario:

  • Users try the application.
  • When they want to buy the application, they select a menu item.
  • The application generates a code that is then passed to the web site to buy the application.
  • Users enter the code returned from the web site.
  • The application checks the entered code with the code it generated.

If users lost the serial number, or copied the application after re-installing the OS, they would require the code to the website, which would return a special code that allow the application to get the original code generated for the users' machine.

like image 370
apaderno Avatar asked Jun 28 '10 04:06

apaderno


People also ask

How are serial numbers created?

A serial number is a unique number used for identification. Serial numbers are made in such a way that they change by a fixed discrete integer value, each time a new serial number is needed.

What is a registration serial number?

Your registration serial number is a 14-character alphanumeric activation code that will fully activate the software. It usually starts with the letter "A". Each registration serial number will only work in the product that was originally purchased or in a minor update to that same product.

Is registration number and serial number the same?

Yes. Most of our documentation, etc. lists the numbers as registration numbers, however, if you have a message or file that refers to serial numbers, you can consider it to be the same number as the registration number.

How are serial numbers assigned?

Serial numbers are typically assigned by production control at some point near the end of the production line. The shipment date of each serial number must be captured by manufacturing for warranty purposes.


2 Answers

You could use asymmetric encryption and hashing, to accomplish this:

  1. You bundle your public key with the application.
  2. When the user buys the application, they supply their name and e-mail address.
  3. The web site hashes the user's name and e-mail address, signs the hash with your private key, and provides the result in Base64 to ease typing.
  4. When the user enters the "code" into your application along with their name and e-mail address, your application can verify that it was signed by your private key (which only you/the web store has access to), and that it matches the name and e-mail provided by the user.
like image 71
Joseph Spiros Avatar answered Sep 18 '22 12:09

Joseph Spiros


There are several open source projects out there that eliminate the need to even think about this. You can focus on writing what your user will actually purchase. There is an opensource framework called Aquatic Prime for generating serial numbers. There are many web portals that work with Aquatic Prime like Shine.

I dont like writing something "new" when there is a perfectly good solution out there (especially since these projects are free)

like image 33
Brent Priddy Avatar answered Sep 20 '22 12:09

Brent Priddy