Computer Science – 17.1 Encryption, Encryption Protocols and Digital Certificates | e-Consult
17.1 Encryption, Encryption Protocols and Digital Certificates (1 questions)
A hash function is a mathematical function that takes an input of arbitrary size and produces a fixed-size output, known as a hash value or digest. It's a one-way function, meaning it's computationally infeasible to reverse the process – to determine the original input from the hash value.
Properties of Hash Functions:
- Deterministic: The same input always produces the same output.
- Pre-image resistance: Given a hash value, it's computationally infeasible to find an input that produces that hash.
- Second pre-image resistance: Given an input and its hash, it's computationally infeasible to find a different input that produces the same hash.
- Collision resistance: It's computationally infeasible to find two different inputs that produce the same hash value.
Usefulness in Cryptography: Hash functions are used for data integrity checks. By hashing a file and storing the hash value, you can later verify that the file hasn't been altered. They are also used in password storage (storing the hash of the password instead of the password itself) and digital signatures.
Example: SHA-256 (Secure Hash Algorithm 256-bit) is a widely used cryptographic hash algorithm. It produces a 256-bit hash value.