cryptographic hash

541 阅读1分钟

Cryptographic hashes 特点如下

  1. 确定性 - 同一个数据总是对应着同一个哈希值
  2. 无关性 - 哈希值之间是无关联的,对一个数据的任何修改必然对应一个完全不同的哈希值
  3. 唯一性 - 同一个哈希值不可能对应两个不同的数据
  4. 单向性 - 无法反向从一个哈希值推判出数据

cryptographic hashes 发展史

  • MD5: Designed by Ron Rivest in 1991 to replace an earlier hash function MD4. "MD" stands for "Message Digest". Produces a hash of 128 bits (16 bytes). Suitable for non-cryptographic uses, such as basic data integrity. Collisions against MD5 can be calculated within seconds which makes the algorithm unsuitable as a cryptographic hash.
  • SHA-1: Developed as part of the U.S. Government's Capstone project. The original specification of the algorithm was published in 1993. "SHA" stands for "Secure Hash Algorithm". Produces a hash of 160 bits (20 bytes). Collisions against SHA-1 have been produced and this hash function should be considered broken.
  • SHA-2: Designed by the United States National Security Agency (NSA), first published in 2001. SHA-2 basically consists of two hash algorithms: SHA-256 and SHA-512. SHA-512 is more secure than SHA-256. There are a number of variants of both algorithms. SHA-256 produces a hash of 256 bits (32 bytes) and SHA-512 produces a hash of 512 bits (64 bytes).
  • SHA-3: Released by NIST in 2015. SHA-3 is a subset of the broader cryptographic primitive family Keccak. SHA-3 has the same output sizes as SHA-2: 224, 256, 384 and 512 bits.