Cryptography · Study deck
Hash Functions and Data Integrity
Picture a field unit downloading new software and a short check value.
Shield Shelly is your guide for this deck.

After studying this chapter
Learning objectives
You will be able to:
- Explain: A match can show that the bytes equal the expected copy, but it cannot show who chose that copy unless the expected value is protected.
- Explain: The digest can tell whether the bytes match an expected value, but it cannot say who chose that value unless the expected value is protected.
- Explain: Anyone can replace both a message and its unprotected digest, whereas only a holder of the HMAC key should create a valid tag.
- Explain: Hash one known file, change one byte, use an attacker-chosen expected value, repeat an old release, and restart the verifier.
Major section
Start With the Fingerprint Question
A match can show that the bytes equal the expected copy, but it cannot show who chose that copy unless the expected value is protected.
- The first test changes one byte and names the trust source.
- Firmware means the software stored on a device.
- A gateway means a device or service that joins two system paths.
Major section
Start With the Fingerprint Question (continued)
Telemetry means measurements and status sent for remote use.
- Hash one known file, change one byte, use an attacker-chosen expected value, repeat an old release, and restart the verifier.
- This runway does not prove identity, secrecy, or freshness from a plain hash.
- The digest can tell whether the bytes match an expected value, but it cannot say who chose that value unless the expected value is protected.
Major section
A Fingerprint for Data, Not a Lock and Not a Signature
The release branch then asks whether the primitive, context, failure behavior, and migration path fit that role.
- This map supplies the distinctions the rest of the chapter will prove.
Major section
Choose the Construction and Protect the Expected Value
Anyone can replace both a message and its unprotected digest, whereas only a holder of the HMAC key should create a valid tag.
- The receiver still needs exact byte and context rules and a constant-time comparison.
Major section
Pin One Firmware Image to One Digest
For hash integrity, in this hash-function check, the device may hash the downloaded image and compare it with a signed manifest digest.
- At the firmware integrity boundary, a matching hash shows the checked bytes match that authenticated expectation.
- A password KDF adds salt and deliberate work to slow each guess.
Deck summary
Key takeaways
A match can show that the bytes equal the expected copy, but it cannot show who chose that copy unless the expected value is protected.
- Telemetry means measurements and status sent for remote use.
- The release branch then asks whether the primitive, context, failure behavior, and migration path fit that role.
- Anyone can replace both a message and its unprotected digest, whereas only a holder of the HMAC key should create a valid tag.
- For hash integrity, in this hash-function check, the device may hash the downloaded image and compare it with a signed manifest digest.
Retrieval practice
Recall check 1 of 3

Shield Shelly says: answer from memory, then check your reasoning.
Q1A vendor says, 'We hash the sensor readings, so they are encrypted and safe.' What is the strongest correction?
Show answer
Answer: A A hash is not encryption: it cannot be reversed to hide and reveal data, and anyone can recompute it, so it does not authenticate the sender.
Retrieval practice
Recall check 2 of 3

Shield Shelly says: answer from memory, then check your reasoning.
Q2Two devices share a secret key and need each message to prove it came from the peer and was not altered. A developer appends a plain SHA-256 digest of the message. Why is this insufficient, and what fixes it?
Show answer
Answer: A A keyless digest authenticates no one.
Retrieval practice
Recall check 3 of 3

Shield Shelly says: answer from memory, then check your reasoning.
Q3A team keeps signing firmware manifests with a hash that has known practical collisions, arguing the digest is long enough to be safe. Why is this unsafe specifically for signatures?
Show answer
Answer: B Signatures bind to a digest, so a usable collision lets a valid signature transfer to a different document.
Print reference
Answers
Answer key.
- A · A hash is not encryption: it cannot be reversed to hide and reveal data, and anyone can recompute it, so it does not authenticate the sender.
- A · A keyless digest authenticates no one.
- B · Signatures bind to a digest, so a usable collision lets a valid signature transfer to a different document.