CYBER LIBRARY
Explore the bootcamp
Security essentialsBeginner

Cryptographic hashing

Explore cryptographic digests, file comparisons, collisions, and trusted reference values through an evidence-copy example.

3 min readUpdated 12 Oct 202614 connections
Markdown

A compact representation of input bytes

A cryptographic hash function maps input data to a digest of a defined length. The same bytes processed by the same algorithm produce the same result. A small input change normally produces a very different digest. This makes hashes useful for comparing files and detecting changes without displaying their contents.

A digest is not encrypted data. There is no decryption key that recovers the original input. However, if the input comes from a small predictable set, someone can hash possible candidates and compare them. This is one reason ordinary fast hashing is insufficient for Password storage.

Comparing an evidence copy

Imagine an investigator receives an authorized disk-image file and a recorded SHA-256 digest from the collection process. Before analysis, the investigator calculates the digest of the received file using the specified algorithm. A mismatch shows the compared byte sequences differ; it does not explain whether copying failed, a file was selected incorrectly, or deliberate modification occurred.

A matching result supports byte-level consistency with the reference under the hash function's assumptions. It does not establish that the collection was complete, that the source clock was correct, or that the reference itself came from a trustworthy person. Chain of custody records handling information that the digest cannot supply.

Three resistance properties

Preimage resistance concerns the difficulty of finding an input for a specified digest. Second-preimage resistance concerns finding a different input with the same digest as a particular input. Collision resistance concerns finding any two different inputs with a matching digest. These are related but distinct requirements.

Because a fixed-length output represents many possible inputs, collisions must exist mathematically. A useful cryptographic design makes finding the relevant collisions computationally impractical under its assumptions. “Every possible file has a unique hash” is therefore an inaccurate explanation.

The reference value needs its own trust route

Imagine downloading a utility and its checksum from a compromised page. An attacker replaces both the file and the displayed checksum. Your comparison succeeds because the two maliciously supplied values agree. The comparison cannot provide publisher authenticity when its reference is controlled by the same attacker.

Digital signatures introduces verification using a trusted public key. A message authentication code provides another construction for parties that share secret key material. Both address authenticity in ways a bare public digest does not provide on its own.

A safe local experiment

Create a small text file containing invented text. Calculate its SHA-256 digest with a trusted local utility, change one character, and calculate it again. Restore the original bytes and repeat. Record the algorithm, file selected, and digest each time.

Be careful about invisible differences: a newline, character encoding, or metadata included in an archive can change the bytes being hashed. Two documents that look identical on screen need not be byte-for-byte identical.

The useful conclusion from this exercise is precise: the digest comparison tells you something about bytes and a reference value. It does not judge whether the content is safe, true, or authorized. Those questions require additional evidence and a suitable security process.

GO TO THE SOURCE

References & further reading

Original explanations, with primary references for deeper study.

NIST: Cryptographic Standards and GuidelinesNIST: Hash Functions
EXPLORE THIS IDEA’S CONNECTIONS

A small part of a bigger picture.

12 notes · 14 connections
100%
Cryptographic hashing · depth 1
Drag to pan · Pinch or use +/− to zoom · Click to preview · Double-click to read
Browse notes as a list (12)
FOLLOW ANOTHER THREADExplore the rest of the library
Start with a concept. Follow its connections.
Detection & responseAbuse Elevation Control MechanismElevation-control abuse bypasses or misuses mechanisms governing privileged execution.Making change happenAcceptance criteriaDefine observable conditions for a deliverable to be accepted.Security essentialsAccess controlUnderstand subjects, resources, permissions, and enforcement through a shared-drive example, including how access changes over time.Detection & responseAccess Token ManipulationAccess token manipulation changes or adopts operating-system security contexts.Risk & resilienceAccount Access RemovalAccount access removal disrupts legitimate users by changing, deleting, or restricting their identities.Evidence & investigationAccount DiscoveryAccount discovery enumerates identities available in a system or environment.Detection & responseAccount ManipulationAccount manipulation changes identity settings to preserve or expand access.Adversarial thinkingAcquire InfrastructureInfrastructure acquisition obtains domains, servers, or other resources used to support operations.Adversarial thinkingActive ScanningActive scanning probes target infrastructure to learn reachable services or weaknesses.Security essentialsAdversary in the middleAn intermediary may observe or alter a communication path.Security essentialsAESA symmetric block cipher whose safe use depends on its mode and implementation.Making change happenAgile deliveryUse short feedback cycles to adapt toward a useful outcome.