SHA-256
SHA-256 is a standardized cryptographic hash function in the SHA-2 family that maps 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.
Fundamentals of Cybersecurity
SHA-256 is a cryptographic hash algorithm that produces a 256-bit hash digest from input data.
- How it is used
- Uses SHA-256 to illustrate password hashing and to check whether files have changed during transmission.
- How deep it goes
- Defines the fixed-length digest and shows comparison checks, while deferring fuller hashing detail to cryptography.
- Examples
- Uses a password login comparison and a downloaded-file checksum comparison as practical examples.
- What you can do after
- Apply a hashing tool to a downloaded file and compare its SHA-256 checksum with the website’s value to check for alteration or corruption.
Also covered in
What to know first
- hash functionA hash function is a deterministic function that maps input data to a hash value, typically of fixed size, for uses such as lookup, indexing, comparison, or integrity checking.
- SHA-1SHA-1 is a cryptographic hash algorithm that produces a 160-bit digest and is no longer considered collision-resistant because practical collision attacks exist.
- SHA-3SHA-3 is a NIST-standardized family of cryptographic hash functions based on the Keccak sponge construction and providing multiple fixed-length output sizes.
- digital signatureA digital signature is a cryptographic value associated with data that can be verified to provide evidence of the data’s origin and integrity.
Related concepts
- hash functionkind of · A hash function is a deterministic function that maps input data to a hash value, typically of fixed size, for uses such as lookup, indexing, 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.
- cryptographic hashkind of · A cryptographic hash is a fixed-length digest computed deterministically from input data by a function designed to resist practical preimage, second-preimage, and collision attacks.
Questions about SHA-256
What is SHA-256?
SHA-256 is a standardized cryptographic hash function in the SHA-2 family that maps input data to a fixed-length 256-bit digest.
Which Manning books explain SHA-256?
Software Security for Developers, Hacking Cryptography, Real-World Cryptography, Effective Data Analysis and Fundamentals of Cybersecurity.
What should I know before learning SHA-256?
Manning books that teach SHA-256 usually introduce hash function, SHA-1, SHA-3 and digital signature first.
What is SHA-256 a kind of?
SHA-256 is a kind of hash function. A hash function is a deterministic function that maps input data to a hash value, typically of fixed size, for uses such as lookup, indexing, comparison, or integrity checking.
What is SHA-256 also called?
SHA-256 is also called sha256.
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.




