Link to home
Start Free TrialLog in
Avatar of s2000_com
s2000_com

asked on

Key / Serial nr generator PHP script

Hi,

I'm searching for a PHP script creating a key or serial nr (containg only basic chars : 0-9 / A-Z) based on a String. I have to be able to revert the key / serial number to get back the String.

Example :
String : 20090401MYLICENSEJOHNDOE
Key or Serial nr : AHSH-D33D-DFKH-JF236-768D

Thanks in advance.

Phil
Avatar of ollyatstithians
ollyatstithians
Flag of United Kingdom of Great Britain and Northern Ireland image

The crypt() function can produce a hash from a seed string, and then turn it back again. This is the basis of many (all?) encrypted password systems.
Have a look in the PHP manual:

http://uk3.php.net/manual/en/function.crypt.php
Avatar of mostart
mostart

as far as I can see on the php.net page crypt will not decrypt encrypted strings.

check mcrypt instead:
http://de3.php.net/manual/de/function.mcrypt-encrypt.php 
Avatar of s2000_com

ASKER

ollyatstithians: It seems that mostart is right !

mostart: I tried mcrypt but the encrypted string contains other chars than 0-9 / A-Z

I need a generator script which can produce string like the one we can see when you activate a product like Windows, Office or others.

Any other suggestions ?
Hi,

I'm searching for a PHP script similar to this tool :  http://ellipter.com/features/

The script must be able to create and revert the key.
ASKER CERTIFIED SOLUTION
Avatar of mostart
mostart

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I used a similar approach.