Information Security Basics

Which statement correctly describes a property of hash functions used in cryptography (cryptographic hash functions)?

  1. AThe original data can be recovered from the hash value by using a private key
  2. BThe hash value gets longer in proportion to the length of the input
  3. 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.
Practice this topic Back to topic

Related calculators

Books on Information Security Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Information Security Basics questions

  1. For an ideal hash function with a 256-bit output, which combination gives the approximate number of computations needed for a brute-force attack in two cases: finding an input that produces a given hash value (a preimage attack), and finding any two different inputs that produce the same hash value (a collision attack)?
  2. When a web service stores users' passwords, it adds a random value that differs for each user (a salt) to the password before computing and storing the hash value. What is the main purpose of the salt?
  3. For storing passwords, it is recommended not to use a fast hash function such as SHA-256 directly but a scheme deliberately designed to take time to compute, such as bcrypt or Argon2. Why?
  4. An 8-character password is searched for by brute force, trying every candidate. If 1×10^10 candidates can be tried per second, which combination is closest to the time needed to try all candidates for a password made only of lowercase letters (26 kinds) and one made of uppercase letters, lowercase letters and digits (62 kinds)?
  5. A attaches a digital signature to a document sent to B. Which combination correctly gives the keys used to create and verify the signature and what the digital signature can confirm?