Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unique Certificate ID

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH
What would be the best way to make a unique certificate id for each certificate produced on my site, I was using a encryptor to decript the certificate id... but the encryption was way to long. I want the length to be like 6 to 10 chacters (so the client doesn't have to type in a long id number to look it up). Numbers and letters or just numbers. But I don't want to have to store the id in the db, I want to encrypt the certificate id.

- Jason

ps. I'll give a star to whoever can help me out on this one.
www.vzio.com
ASP WEB DEVELOPMENT



 
Does the number need to stand for anything in particular or should it be utter nonsense?
Assuming it should stand for something, what type of information are you trying to get back out of the certificate id?


-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
When the user prints out their certificate and they have a person who wants to verify that its is a valid certificate, they can come to the website and type in that Unique Certificate id which would bring up that certicate as "verified" the number or number / alpha needs to stand for the autonumber id for that certificate. It will be added to this:

02-xxxxxxx the start of it being the year..

- Jason

Thanks for your quick response Tarwn. www.vzio.com
ASP WEB DEVELOPMENT



 
I'm still not sure I am getting it, but I am brewiung coffee so it may become clearer :)
How about just using yy-(yyyy+amt) where the part in the parantheses has been added and converted to base 6? This ought to cause the number encrypt in a confusing manner but still make it recoverable. If it absolutely must be unique then convert it to base 16 and give them a 4 or 5 digit autonumber after it:
yy-(yyyy+amt+autonumber)<sub>16</sub>-autonumber
ie:
2002, amt = $50, autonumber = 1234
key would be 02-CD6-1234

2002, amt = 30, autonumber = 1235
key would be 02-CC3-1235

2002, amt = 20, autonumber = 1245 (notice middle part will be the same as previous)
key would be 02-CC3-1245

To decode all you would need to do is convert the center back to base 10 (decimal) and subtract the autonumber and the 4 digit year (which will start with 20 for the next 98 years :) )

This may be a little to simple, but let me know if you think I am on track :)

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top