Page 1 of 1

i want to do some security

Posted: Fri Dec 10, 2010 2:17 pm
by mo2sh
hi all,
i Apologize if my topic is in wrong forum.
i want to do something that my script work on one domain

example domain.com
and if any one put it on other domain don't work
but i don't Know the code :banghead:
can any one help me plz :oops:

Re: i want to do some security

Posted: Fri Dec 10, 2010 4:30 pm
by Apollo
Encrypt the entire code (or at least an essential / 'main' php file), using a checksum of the required host name as the encryption key.

Then in a stub php file, do something along the lines of eval(your_favorite_decypt_function(the_encrypted_code,sha512(the_current_domain))).
Optionally, checksum-verify the decrypted result before eval'ing it to avoid random garbage on invalid domains.

Obviously this is not secure if people know on what domain this is supposed to run (in that case they can simply fake the host name). You could add some salt data stored in a database and/or local (non-http-accessible) file. That way, even if they get access to your php files and know on which server it's supposed to run, they still can't obtain the key necessary to run the code.

Re: i want to do some security

Posted: Fri Dec 10, 2010 4:38 pm
by mo2sh
thanks Apollo,
can u give me code because i don't know exactly the code

Re: i want to do some security

Posted: Sat Dec 11, 2010 2:40 am
by Apollo
I don't have any code for this, but the above pretty much explains itself. Look on php.net for the necessary functions.