1. Home
  2. /
  3. Web technology
  4. /
  5. PHP
  6. /
  7. [ PHP ] –...

[ PHP ] – hash() 產生不可逆的雜湊加密字串

評等結果
點擊便能為這篇文章進行評等!
[評等總次數: 0,平均評等: 0]

小編以往比較常用的是md5加密,但 md5 已經有太多 Rainbow Table 可以用來破解,所以現在比較常用 hash() 以 sha256 來加密字串。

echo 'hash(\'sha256\',\'abcdefg\'):'.'<br>';
echo hash('sha256','abcdefg').'<br>';
echo 'print_r(hash_algos()):'.'<br>';
print_r(hash_algos());
//顯示結果
/*
hash('sha256','abcdefg'):
7d1a54127b222502f5b79b5fb0803061152a44f92b37e23c6527baf665d4da9a
print_r(hash_algos()):
Array ( [0] => md2 [1] => md4 [2] => md5 [3] => sha1 [4] => sha224 [5] => sha256 [6] => sha384 [7] => sha512/224 [8] => sha512/256 [9] => sha512 [10] => sha3-224 [11] => sha3-256 [12] => sha3-384 [13] => sha3-512 [14] => ripemd128 [15] => ripemd160 [16] => ripemd256 [17] => ripemd320 [18] => whirlpool [19] => tiger128,3 [20] => tiger160,3 [21] => tiger192,3 [22] => tiger128,4 [23] => tiger160,4 [24] => tiger192,4 [25] => snefru [26] => snefru256 [27] => gost [28] => gost-crypto [29] => adler32 [30] => crc32 [31] => crc32b [32] => fnv132 [33] => fnv1a32 [34] => fnv164 [35] => fnv1a64 [36] => joaat [37] => haval128,3 [38] => haval160,3 [39] => haval192,3 [40] => haval224,3 [41] => haval256,3 [42] => haval128,4 [43] => haval160,4 [44] => haval192,4 [45] => haval224,4 [46] => haval256,4 [47] => haval128,5 [48] => haval160,5 [49] => haval192,5 [50] => haval224,5 [51] => haval256,5 )
*/

評等結果
點擊便能為這篇文章進行評等!
[評等總次數: 0,平均評等: 0]

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *