I want to re-use some code in an old system, but the oldest php version that I can install is php 5.4, due to I need phpmyadmin, and it cannot be found in CentOS 5.11, so I need to convert the code to php 5.4 format, I have the following code:
function encrypted($secret1){
RETURN mcrypt_cbc(MCRYPT_RIJNDAEL_128,substr(KEY,0,32) ,$secret1,MCRYPT_ENCRYPT,substr(KEY,32,16));
}
function decrypted($secret2){
RETURN mcrypt_cbc(MCRYPT_RIJNDAEL_128,substr(KEY,0,32) ,$secret2,MCRYPT_DECRYPT,substr(KEY,32,16));
}
Can I change them directly to:
function encrypted($secret1){
RETURN mcrypt_encrypt(MCRYPT_RIJNDAEL_128,substr(KEY,0,32) ,$secret1,MCRYPT_ENCRYPT,substr(KEY,32,16));
}
function decrypted($secret2){
RETURN mcrypt_decrypt(MCRYPT_RIJNDAEL_128,substr(KEY,0,32) ,$secret2,MCRYPT_DECRYPT,substr(KEY,32,16));
}
Thanks a lot