Hoping someone can shed some light on this.
I am updating some older code which uses the mcrypt_generic
function, utilizing a DES-CBC cipher
When I update this code to use the openssl_encrypt
, I get the same output, but with 8 bytes appended to the end of my encoded string.
Before
$this->_cipher = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_CBC,'');
mcrypt_generic_init($this->_cipher, $this->_key, $this->_iv)
mcrypt_generic($this->_cipher, $text)
Before method output:
27049189e7e08db6
After
openssl_encrypt($text, "DES-CBC", $this->_key, OPENSSL_RAW_DATA , $this->_iv);
After method output:
27049189e7e08db6d504d16516e1c567
Why is this happening, and what (other then a substring) can be done to prevent it?