PHP 加密算法 openssl_encrypt vs mcrypt_encrypt

$key = "anotherpassword1";
$str = "does it work 12";
$enc = mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $str . "\1", MCRYPT_MODE_ECB);
$dec = mcrypt_decrypt(MCRYPT_BLOWFISH, $key, $enc, MCRYPT_MODE_ECB);
echo(bin2hex($enc) . PHP_EOL);
var_dump($dec);
$enc = openssl_encrypt($str, 'bf-ecb', $key, true);
$dec = openssl_decrypt($enc, 'bf-ecb', $key, true);
echo(bin2hex($enc) . PHP_EOL);
var_dump($dec);

实测结论:
1. mcrypt_encrypt的加密密钥超过56个字符串则报错
2. 当字符串$str的长度是len = (16*N)-1 时, mcrypt_decrypt 与 openssl_decrypt 可互相解密。(N取正整数)
3. openssl_decrypt加密过的数据可以用mcrypt_decrypt解密,不管$str长度是多少

引用http://php.net/manual/en/function.openssl-encrypt.php
http://php.net/manual/en/function.mcrypt-encrypt.php
http://php.net/manual/en/function.mcrypt-generic.php
http://stackoverflow.com/questions/9993909/php-replace-mcrypt-with-openssl