Encyclopedia Privacy & cryptography · Entry 434
Hash functions vs encryption: checking data and keeping it secret
In this article
At a glance
Key facts
Use a hash to check a copy
Imagine downloading a wallet installer. Computing its hash lets you compare the file with a published digest. A mismatch means the bytes differ; it does not tell you whether the cause was an interrupted download, another version or tampering.
Use encryption when someone must read it later
An encrypted backup is intended to become readable again with the right key. A hash is not a compressed backup and cannot restore the original file. These operations solve different problems, even when an application uses both.
A matching hash still needs a trusted reference
If an attacker replaces a download and its published digest together, the two can still match. Check how the reference was obtained. A digital signature can connect a file to a signing key, provided you have established which key to trust.
A digest also does not make a short PIN private. Someone can hash plausible PINs and compare them. When evaluating a system, ask whether it needs an integrity check, confidentiality, or protection for a guessable secret.
Direct answers
Questions people ask
Can two different inputs have the same hash?
Yes: a fixed-size digest has fewer possible values than all possible inputs. Cryptographic collision resistance means finding a matching pair should be impractical for the chosen secure function, not that such pairs cannot exist.
Inspect the evidence
The answer and key facts have stable claim links. These records retain the scope and qualification when reused.
A cryptographic hash produces a short digest that helps check data. Encryption transforms data so someone with the appropriate key can recover the original. A hash has no decryption key: it is designed to make finding an input from its digest impractical. Hashing a predictable secret does not stop someone from guessing it and comparing the result.
Scope: Privacy & cryptography · data through 2026-11-18. Verification: verified · 2026-11-19T01:30:46.076Z.
Link to this claimHashing: A digest can help detect changed data.
Scope: Privacy & cryptography · data through 2026-11-18. Verification: verified · 2026-11-19T01:30:46.076Z.
Link to this claimEncryption: Encryption has a corresponding decryption operation.
Scope: Privacy & cryptography · data through 2026-11-18. Verification: verified · 2026-11-19T01:30:46.076Z.
Link to this claimGuessing: A one-way function does not prevent testing candidate inputs.
Scope: Privacy & cryptography · data through 2026-11-18. Verification: verified · 2026-11-19T01:30:46.076Z.
Link to this claimRevision history
- — First publication with primary sources and separate automated evidence review.
On the Understand what a proof reveals path · Learn next: Digital signatures vs encryption: what does signing prove?
Source register
Sources and references
Retrieval dates and locators are recorded individually.- Secure Hash Standard (SHS), FIPS 180-4NIST
The abstract explains message digests and detecting changed messages.
Locator: Abstract · Retrieved: 2026-11-19T01:25:11.087665+00:00Open source - Advanced Encryption Standard (AES), FIPS 197NIST
Defines reversible encryption and decryption with a symmetric block cipher.
Locator: Sections 2.1 Terms and Acronyms, 5.1 CIPHER(), and 5.3 INVCIPHER() · Retrieved: 2026-11-19T01:28:17.690479+00:00Open source - RFC 4949: Internet Security Glossary, Version 2RFC Editor
Definitions distinguish cryptographic hash functions, encryption, authentication and digital signatures.
Locator: Entries: hash function, encryption, digital signature, data integrity · Retrieved: 2026-11-19T01:25:11.350738+00:00Open source
Research and drafting use AI assistance. A separate automated review checks claims against primary sources; no external expert or named human review is implied. Publication, substantive editing, source retrieval and verification are recorded separately. This version was independently checked by an automated reviewer on 19 November 2026.
Editorial method and correctionsDegrees of Satoshi editorial project. “Hash functions vs encryption: checking data and keeping it secret.” Published 2026-11-18; updated 2026-11-18. https://degreesofsatoshi.com/encyclopedia/hash-functions-vs-encryption/