0

I made a PHP script. Now I want to generate unique random licence key for a particular client for a particular IP address. I want strong security for licence key like ie.If client install script in particular IP address or particular domain then he can't instal the same script on another machine or another domain with same licence key.what is the logic or coding when client install script only one domain or only one ipaddress..client cant install script on another machine or anther ipaddress or another domain.

Please give me some ideas or code for generating such a licence key in PHP.

hakre
  • 193,403
  • 52
  • 435
  • 836
parul_sgc
  • 1
  • 1
  • 3

3 Answers3

1

Take the IP address, salt it with the client's name, or a fixed string then use bcrypt.

Note: this will be secure the way you described, but it's not secure in a sense that if the user is able to read your source code used for verification he can easily create a new licence key for any IP.

An assymetric public/private key solution could solve this problem, but might be too complicated for you. PHP has openSSL.

Community
  • 1
  • 1
Karoly Horvath
  • 94,607
  • 11
  • 117
  • 176
  • To expand on this in the install of your script (or on first run, whatever). You can connect to your own 'registration servers' to validate the key (since you have the algorithm to make them) and either allow or disallow the install. It is all moot though, they can just edit the source and comment out the licensing. – supakeen Aug 09 '11 at 08:16
  • Right.. it's true for any copy protection, but especially easy for PHP where the code is visible and easily modifiable. – Karoly Horvath Aug 09 '11 at 08:21
0

Use some sort of salted hash with the clients details.
Then you should use Zend Guard to protect that sensitive code.

Filipe YaBa Polido
  • 1,656
  • 1
  • 17
  • 39
0

Try something like Md5 using variables like the users country and email address.
Check out http://php.net/manual/en/function.md5.php

neo
  • 155
  • 4