Is storing emails in databases encrypted using encrypt() function in php secure ? If yes then how can i decrypt it if not then what's a better idea ? example : crypt() function
Asked
Active
Viewed 78 times
-1
-
Define "secure"; it depends where you store the key, etc.! Also, what is the encrypt() function? – Oliver Charlesworth Jan 01 '13 at 17:36
-
it's the crypt() function – user1477731 Jan 01 '13 at 17:38
-
1`crypt()` is not an encryption function, it's a hashing function. It cannot be reversed. Any of the real encryption functions will either have equivalent decryption functions (e.g. `mcrypt_encrypt`/`mcrypt_decrypt`), or will take a parameter to specify whether they should encrypt or decrypt. – Oliver Charlesworth Jan 01 '13 at 17:39
-
so what do you suggest , a secure way for encrypting using encrypt functions in php ? – user1477731 Jan 01 '13 at 17:41
2 Answers
1
The best you're going to get is with a Rijndael encryption. What you're doing is hashing which isn't reversible.
Check this out for AES encryption in PHP: