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
dongshao8566
2011/07/06 15:50
  • cryptography
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复