Mcrypt 2.4.7 は強力な暗号化アルゴリズム拡張ライブラリであり、次のアルゴリズムを含む 22 のアルゴリズムが含まれています:
以下は引用内容です:
Cast-256 RC4 Safer-sk128 |
以下为引用的内容: gunzipmcrypt-x.x.x.tar.gz tar -xvfmcrypt-x.x.x.tar ./configure --disable-posix-threads make make install cd to your PHP directory. ./configure -with-mcrypt=[dir] [--other-configuration-directives] make make install |
引用内容は次のとおりです: tar -xvfmcrypt-x.x.x.tar ./configure --disable-posix-threads make make install
|
以下为引用的内容: Original string: Applied Cryptography, by Bruce Schneier, is a wonderful cryptography reference. Encrypted string: 02a7c58b1ebd22a9523468694b091e60411cc4dea8652bb8072 34fa06bbfb20e71ecf525f29df58e28f3d9bf541f7ebcecf62b c89fde4d8e7ba1e6cc9ea24850478c11742f5cfa1d23fe22fe8 bfbab5e Decrypted string: Applied Cryptography, by Bruce Schneier, is a wonderful cryptography reference. |
以下は引用内容です:<?php // 暗号化する文字列を指定 $string = "Applied Cryptography、Bruce Schneier は、素晴らしい暗号化リファレンスです。"; // 暗号化/復号化キー $key = "4 スコアと 20 年前"; // 暗号化アルゴリズム $cipher_alg = MCRYPT_RIJNDAEL_128; // セキュリティを強化するための初期化ベクトルを作成します。 $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg, MCRYPT_MODE_ECB) 、 MCRYPT_RAND ); // 元の文字列を出力 print "元の文字列: $string "; $ string $encrypted_string = mcrypt_encrypt($cipher_alg, $key, $string, MCRYPT_MODE_CBC, $iv); 16 進数でブラウザに出力します。 print "暗号化された文字列: ".bin2hex($encrypted_string)." " $decrypted_string = mcrypt_decrypt($cipher_alg, $ key , $encrypted_string, MCRYPT_MODE_CBC, $iv); print "復号化された文字列: $decrypted_string"; | ; >
以下は引用された内容です:元の文字列: Applied Cryptography、Bruce 著Schneier は、素晴らしい暗号化リファレンスです。 1f7ebcecf62b c89fde4d8e7ba1e6cc9ea24850478c11742f5cfa1d23fe22fe8 bfbab5e 復号化された文字列: Applied Cryptography (Bruce Schneier 著) は、素晴らしい暗号化リファレンスです。 . |