Which is a property of a cryptographic hash function like SHA-256?
Options
- You can easily reverse it to recover the input
- Same input, same output; a tiny change alters it all (Correct option)
- The output length grows as the input gets longer
- It needs a secret key in order to run properly
Answer
The same input always gives the same output, and a tiny change in input gives a completely different output
Why
A hash function turns any input into a fixed-size fingerprint (SHA-256: 64 hex characters).
- Deterministic: same input, same hash.
- One-way: you cannot get the input back from the hash.
- Tiny change → totally different hash.
- Collisions (two inputs, same hash) are practically impossible to find.
Uses: checking downloads, digital signatures, git commit IDs. For passwords use a slow, salted variant.
Remember
Hash = deterministic, one-way, fixed-size fingerprint.