Hash functions and digital signatures
Cryptographic hashes give fixed-size fingerprints of data; signatures prove who signed it and that it was not altered.
Edited by Alex C, EduAlx · Sources cited below
Explanation
Good hashes (SHA-256, SHA-3) are pre-image and collision resistant; MD5 and SHA-1 are broken for collisions. Digital signatures (RSA, ECDSA, Ed25519) sign a hash with a private key; anyone verifies with the public key. Certificates and PKI bind keys to identities, enabling HTTPS.
Example
Code
import hashlib print(hashlib.sha256(b'abc').hexdigest())
How it works, step by step
- Hash the message
- Sign the hash with the private key
- Send message + signature
- Receiver hashes and verifies with the public key
Open the interactive page with diagrams →
People behind it
- Ralph Merkle
- Ron Rivest (b. 1947), Cryptography, USA: MIT professor; co-invented RSA and designed MD5 and RC4. Turing Award 2002; co-author of CLRS.
- Whitfield Diffie (b. 1944), Cryptography, USA: Co-invented public-key cryptography (1976). Turing Award 2015.
- Martin Hellman (b. 1945), Cryptography, USA: Stanford professor; co-invented Diffie–Hellman key exchange. Turing Award 2015.
References
- NIST FIPS 180-4, Secure Hash Standard, 2015.
- NIST FIPS 186-5, Digital Signature Standard, 2023.
Textbooks
- Introduction to Modern Cryptography, Jonathan Katz, Yehuda Lindell (CRC Press, 3rd ed. 2020). Rigorous cryptography.
Related topics
Public-key cryptography (Diffie–Hellman, RSA)Computer security fundamentals (CIA triad)Web development: front end and back endSearch engines and PageRankDistributed systems: CAP theorem and consensusComputer vision and convolutional neural networksCloud computingNatural language processingVirtualisation and containersReinforcement learning