Created
April 19, 2012 02:34
-
-
Save run26kimo/2417960 to your computer and use it in GitHub Desktop.
mcrypt_ecb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$key = "admlX71MbBLlEznv"; | |
$text = "fleshwound is a farmer,deadly wounded ";//明文 | |
$ctext = base64_encode (mcrypt_ecb (MCRYPT_3DES, $key, $text, MCRYPT_ENCRYPT) ); //加密 | |
$ptext = mcrypt_ecb (MCRYPT_3DES, $key,base64_decode($ctext), MCRYPT_DECRYPT); //解密 | |
echo "明文:$text <br> 密文:$ctext <br>解密后明文:$ptext" | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment