Information Security Basics
Which statement correctly describes a property of hash functions used in cryptography (cryptographic hash functions)?
- AThe original data can be recovered from the hash value by using a private key
- BThe hash value gets longer in proportion to the length of the input
- CThe same input always gives the same hash value, and changing even one bit of the input changes the hash value drastically and unpredictably
Show answer and explanation
Answer: C. The same input always gives the same hash value, and changing even one bit of the input changes the hash value drastically and unpredictably
A hash function computes a value of fixed length (a hash value, or digest) from data of any length. SHA-256, for example, outputs a 256-bit value regardless of the input length. The same input always gives the same value, and even a tiny change in the input changes the output drastically and unpredictably. Hash functions used in cryptography must also make it practically impossible to find the original input from a hash value (one-wayness, or preimage resistance) and hard to find two different inputs with the same hash value (collision resistance). A hash function is a keyless computation, not encryption, so it cannot be decrypted back to the original. It is used for detecting tampering, digital signatures, password storage and more.
- A. A hash function uses no key and has no way of being reversed. Being irreversible (one-wayness) is a key property.
- B. The length of a hash value is fixed regardless of the input length (256 bits for SHA-256).
- C. Correct. The same input gives the same value, and a slightly different input gives a completely different value.