再会!我这里有一个代码,它使用blowfish_PP
来自Crypt::Blowfish_PP的算法来加密密码。
我已经为开始提供了一个示例“key”变量(尽管稍后我将创建一个函数,每次使用它时都会增加 key),但现在这就是我所拥有的:
use Crypt::Blowfish_PP;
$key = "12345678";
$$plaintextBlock = "mystringhere";
$blowfish=new Crypt::Blowfish_PP($key);
$ciphertextBlock=$blowfish->encrypt($plaintextBlock);
$plaintextBlock=$blowfish->decrypt($ciphertextBlock);
print "\n";
print $ciphertextBlock."\n";
print $plaintextBlock."\n";
这$ciphertextBlock
仅输出 5 个字符。当我encryptedpassword
使用 MD5 检查其他数据库时,它包含几个字符。这是为什么?内部
encrypt()
和decrypt()
功能是什么?“密钥”值对加密密码的长度有影响吗?
答案将不胜感激。=)