Remarks

/* Base64 Encoded Encryption / enc_data = base64_encode(openssl_encrypt(data, $method, $password, true, $iv) ); / Decode and Decrypt */ decdata = base64decode(openssl_decrypt(enc_data, $method, $password, true, $iv) );

This way of doing the encryption and encoding would not work as presented as you are decrypting the code before unencoding the base 64.

You would need to do this in the opposite order.

/This way instead/ encdata = base64encode(opensslencrypt(data, $method, $pass, true, $iv)); decdata = openssldecrypt(base64decode(enc_data), $method, $pass, true, $iv);