「Php/可逆暗号」の版間の差分
提供: 初心者エンジニアの簡易メモ
(ページの作成:「Pear::Crypt_Blowfishを使う ==install== pear install Crypt_Blowfish ==sample== <?php require_once 'Crypt/Blowfish.php'; $key = "testtest"; $text = "123...」) |
(相違点なし)
|
2015年5月20日 (水) 03:15時点における最新版
Pear::Crypt_Blowfishを使う
install
pear install Crypt_Blowfish
sample
<?php require_once 'Crypt/Blowfish.php'; $key = "testtest"; $text = "1234567890"; $blowfish = new Crypt_Blowfish($key); $encrypt = base64_encode($blowfish->encrypt($text)); $decrypt = rtrim($blowfish->decrypt(base64_decode($encrypt)), "\0"); print $encrypt; print "\n"; print $decrypt; print "\n";