开发者

How to generate unique licence key for particular IP address in PHP script?

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.


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.


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜