Howdy folks,
I was wondering if PHP offered any sort of encyption that was different for each server.
So like on my server it could be like encrypt($string)...that equals jfdaso8u34wnfa8
While on my friends server if I did the same string so...encrypt($string)....his equals dfjasjfwo3ihfsna
I hope that makes sense, and thanks for your time
Also, I have PHP v4.2.
Thanks again
Encryption Types
Moderator: General Moderators
-
method_man
- Forum Contributor
- Posts: 257
- Joined: Sat Mar 19, 2005 1:38 am
PHP only offers encryptions that is built into its compiler (ie : crypt, md5, etc.). if you want to use a server-based encryption, you are going to need to check with that webserver's website and check with them..
but if ur question is if you use md5 on an apache server and then try to run the same code on an IIS server, and simply want to know if the values will change, then the answer is no. whatever the encryption string is created using an apacehe server is goign to be on an IIS server as the server isn't what is controlling your encryption, but php is. The server just says "ok, you send me a string, and I'll send it wherever you specify". again, that's unless the server has its own built in encryption method and you call that encryption via the server directly.
hope this helps.
but if ur question is if you use md5 on an apache server and then try to run the same code on an IIS server, and simply want to know if the values will change, then the answer is no. whatever the encryption string is created using an apacehe server is goign to be on an IIS server as the server isn't what is controlling your encryption, but php is. The server just says "ok, you send me a string, and I'll send it wherever you specify". again, that's unless the server has its own built in encryption method and you call that encryption via the server directly.
hope this helps.
Re: Encryption Types
Yes and no.milsaw wrote: I was wondering if PHP offered any sort of encyption that was different for each server.
Yes, there is an encryption that you can setup to be different per server - multiple types in fact.
What you are describing is essentially "Salting". If you do md5("whatever") on both servers, the answer will be consistent - the same.
However, by adding a unique "Salt", you can get different results from one machine to the other. So that:
md5("whatever" + $salt) (on server one)
md5("whatever" + $salt) (on server two)
would not be the same, as long as $salt was different between the two. For example, you could do:
$salt = $SERVER['SERVER_NAME'];
and of course it would be different on each.
However, to answer the original question, NO, there is not a type of encryption that automatically salts differently from one server to another, as far as I know.