Decrypting data with openssl commandline tool
I have to following code and as far as I know it is correct, but it does not work. I am trying to encode data with PHP's Mcrpyt and then decode it with the openssl commandline tool. This is my PHP code: /* * Convert a normal ascii string to a hexadecimal string. * Complement of hexToString(). */ function stringToHex($str) { $hex_str = ""; for ($i = 0; $i < strlen($str); ++$i) { $hex_str .= sprintf("%02X", ord($str[$i])); } return $hex_str; } $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_DEV_RANDOM); $block_size = mcrypt_get_block_size("rijndael-128",