SHA-256
SHA-256 is a standardized cryptographic hash function in the SHA-2 family that maps arbitrary input data to a fixed-length 256-bit digest.
Software Security for Developers
SHA-256 is a member of the SHA-2 family of cryptographic hash algorithms that produces a 256-bit digest.
- How it is used
- Detects accidental file corruption before a downstream service processes sensitive operations such as refunds.
- How deep it goes
- Explains repeatable hashing, comparison, rejection behavior, and active-tampering limits, but defers protection against malicious modification to HMAC.
- Examples
- Uses refunds.json and refunds.json.sha256, a warehouse-to-payments workflow, and Java digest computation.
- What you can do after
- Apply it via Java MessageDigest to compute and compare file digests, while recognizing when HMAC is required.
Read how Software Security for Developers explains SHA-256 →
Hacking Cryptography
SHA-256 is a member of the Secure Hash Algorithm 2 family that produces 256-bit cryptographic hash digests.
- How it is used
- Demonstrates how SHA-256-based secret-prefix MACs fail under length-extension attacks in an authenticated transaction API.
- How deep it goes
- Explains Merkle–Damgård state exposure, padding, digest parsing, and HTTP forgery code, stopping short of redesigning authentication.
- Examples
- Uses a bank transaction API, signed query strings, SHA-256 padding, Go code, and an OpenSSL-backed forgery test.
- What you can do after
- Diagnose and reproduce secret-prefix MAC vulnerabilities with Go, cgo, and OpenSSL SHA-256 state manipulation.
Real-World Cryptography
A member of the SHA-2 family of standardized cryptographic hash functions that produces a 256-bit digest.
- How it is used
- Verifies downloaded-file integrity by comparing a computed digest with a trusted published value.
- How deep it goes
- Explains fixed-length hashing, security properties, and high-level SHA-2 construction, stopping short of implementation-level detail.
- Examples
- Uses download verification, OpenSSL commands, repeated inputs, changed inputs, and inputs of different lengths.
- What you can do after
- Apply it via OpenSSL to calculate a file digest and compare that digest against a published verification value.
Effective Data Analysis
SHA-256 is a member of the Secure Hash Algorithm 2 family that produces a 256-bit cryptographic hash.
- How it is used
- Uses SHA-256 to replace sensitive identifiers in analytics data and connect datasets without exposing original values.
- How deep it goes
- Explains deterministic and change-sensitive hashing, demonstrates implementation, and cautions that reversal may become possible; it does not develop cryptographic internals.
- Examples
- Demonstrates hashing email addresses, separating email mappings, and retaining email_hash in a transactions table.
- What you can do after
- Apply it via Python’s hashlib library to create repeatable identifiers and join data while separating original PII.
Related concepts
- hash functionkind of · A hash function deterministically maps input data to a value in a bounded output range, commonly for indexing, lookup, comparison, or integrity checking.
- SHA-2kind of · SHA-2 is a standardized family of cryptographic hash algorithms that produces fixed-length digests, including SHA-224, SHA-256, SHA-384, and SHA-512.
- StandardPasswordEncoderused by · StandardPasswordEncoder is a deprecated Spring Security password encoder that hashes passwords with SHA-256 and an optional secret.
- HMACused by · HMAC is a keyed message authentication code constructed from a cryptographic hash function and a secret key to authenticate data and verify its integrity.
- hmac-sha256used by · HMAC-SHA256 is a keyed message-authentication construction that uses SHA-256 and a shared secret to produce an authentication tag.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



