I recently used the function md5() to secure a password on a form I had to create. I found there were other functions such as crc32() or sha1(). Is md5() the most secure and if so why would you use the others?
$key = 'password to (en/de)crypt';
$string = 'string to be encrypted ';
$encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key))));
$decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($encrypted), MCRYPT_MODE_CBC, md5(md5($key))), "\0");
Users browsing this forum: No registered users and 1 guest