-
-
- /**
- * mcrypt 暗号化と復号化
- * by bbs.it-home.org
- */
- $data = 'data';
- $key = "key";
$algorithm = MCRYPT_BLOWFISH;
- $mode = MCRYPT_MODE_CBC;
- $iv = mcrypt_create_iv(mcrypt_get_iv_size($algorithm,$mode), MCRYPT_DEV_URANDOM);
$encrypted_data = mcrypt_encrypt($algorithm, $key, $data , $mode, $iv);
$decrypted_data = mcrypt_decrypt($algorithm, $key, $encrypted_data, $mode, $iv);
print "解密データは:$decrypted_data";
- ?>
-
复制代
|