PHP mcrypt错误,解密失败
The code below does not decrypt the plaintext correctly. Does anyone know why the decrypt will not give me the correct plain text?
<?php
$key = "ShHhd8a08JhJiho98ayslcjh";
$plaintext = "Let us meet at 9 o'clock at the secret place.";
$cyphertext = "arTdPqWOg6VppOqUD6mGITjb24+x5vJjfAufNQ4DN7rVEtpDmhFnMVM+W/WFlksR";
$encrypted = mcrypt_encrypt(MCRYPT_3DES, $key, $plaintext, MCRYPT_MODE_ECB);
$decrypted = mcrypt_decrypt(MCRYPT_3DES, $key, $cyphertext, MCRYPT_MODE_ECB);
echo base64_encode($encrypted)."</br>";
echo base64_encode($decrypted)."</br>";
?>
dongshao8566
2011/07/06 15:50- cryptography
- php
- 点赞
- 收藏
- 回答
满意答案
1个回复
