For example:
$text = "sample";
$salt = "sh54mdR";
I’d like to store $text value in the db as encrypted by using $salt value. result should be like that:
jkhdnewewjhjjhnd (it's just an example, so I want to hide $text value)
than id like to de-crypt “jkhdnewewjhjjhnd” to “sample” I can’t use md5, sha etc. I’m looking for a way to store the value and than de-crypt it. do you know a PHP function for my request?
Look at the mcrypt functions.
Encrypt:
Decrypt:
See examples from http://us.php.net/manual/en/mcrypt.examples.php
Don’t forget to use base64_encode() before storing in the database, unless the column accepts binary data.