What is Cryptographic Hash Function?
A cryptographic hash function is a mathematical algorithm that takes an input (or "message") and returns a fixed-size string of bytes. The output, typically called a hash or digest, appears random but is unique to the given input.
What is Cryptographic Hash Function?
Hash functions are commonly used data structures in computing systems for tasks such as checking the integrity of messages and authenticating information. While they are considered cryptographically "weak" because they can be solved in polynomial time, they are not easily decipherable.
Cryptographic hash functions add security features to typical hash functions, making it more difficult to detect the contents of a message or information about recipients and senders.
In particular, cryptographic hash functions exhibit these three properties:
- Collision-free: This means that no different inputs should map to the same output hash.
- Hidden: It should be difficult to guess the input value for a hash function from its output.
- Puzzle-friendly: It should be difficult to select an input that provides a predefined output. Thus, the input should be selected from a distribution that's as wide as possible.
Uses in blockchain:
- Data Integrity: Ensures data has not been altered.
- Mining: Miners solve puzzles based on hashing functions to add new blocks to the blockchain.
- Digital Signatures: Used to verify the authenticity and integrity of messages and transactions.