Google 與 CWI Amsterdam 攻陷 SHA-1 演算法

Google 與 CWI Amsterdam 聯手攻陷 SHA-1 演算法,可以產生出不同內容,相同的 SHA-1 的值。(碰撞攻擊 Collision)

閱讀全文〈Google 與 CWI Amsterdam 攻陷 SHA-1 演算法〉

PHP 使用 SHA256、SHA512 等 演算法的寫法

PHP 有 md5()sha1() ... 等等 function,不過現在建議使用 SHA224 以上(註),在 PHP 要怎麼寫呢?

註:下述摘錄自此篇:Mobilefish.com - MD5, SHA1, SHA224, SHA256, SHA384, SHA512 and RIPEMD160 hash generator

  • MD5 is considered cryptographically broken and is unsuitable for further use.
  • The SHA1 algorithm might not be secure enough for ongoing use. It is recommended not to use SHA1.
  • SHA224: SHA224 produces a 224-bit (28-byte) hash value, typically rendered as a hexadecimal number, 56 digits long.
  • SHA256: SHA256 produces a 256-bit (32-byte) hash value, typically rendered as a hexadecimal number, 64 digits long.
  • SHA384: SHA384 produces a 384-bit (48-byte) hash value, typically rendered as a hexadecimal number, 96 digits long.
  • SHA512: SHA512 produces a 512-bit (64-byte) hash value, typically rendered as a hexadecimal number, 128 digits long.
  • RIPEMD160: RIPEMD160 produces a 160-bit (20-byte) hash value, typically rendered as a hexadecimal number, 40 digits long.

閱讀全文〈PHP 使用 SHA256、SHA512 等 演算法的寫法〉