Reference source

Ke.qq.com/course/3140…

What is a one-way hash function

One-way hash function, also known as message digest function, hash function.

The hash value can be calculated based on the message content, which can be understood as the ID of each message.

Characteristics of unidirectional hash functions

1. Calculate a fixed length hash value based on an arbitrary length message.

2. Fast calculation speed, can quickly calculate the hash value.

3. The hash value varies with the message.

4. Unidirectional.

Several common one-way hash functions

1., MD4 and MD5

Generates a 128bit hash value, MD stands for Message Digest, which is no longer secure.

2.SHA-1

Generates a hash value of 160 bits, which is no longer secure.

3.SHA-2

The hash value of SHA-256, SHA-384, and SHA-512 is 256 bits, 384 bits, and 512 bits respectively.

4.SHA-3

New standard

Application of unidirectional hash functions

1. Prevent data tampering.

2. Password encryption: The password is hashed to the server during login to prevent password leakage after the server is breached by hackers.