Encryption, Hashing & Signatures
01 · Concept — what problem does it solve?
Three different tools get called "encryption" in crypto marketing, and only one of them is.
- Encryption hides data from anyone without the key. It is reversible: the right key turns the scrambled bytes back into the original.
- produces a short fingerprint of some data. It is one-way and keyless: you cannot get the data back, but you can check whether two pieces of data are identical.
- Signatures prove that the holder of a specific key authorised a specific message. They hide nothing.
A blockchain uses the second and third. Nothing on Bitcoin or Ethereum is encrypted — every transaction, balance and piece of contract state is readable by anyone, forever. That is the design: strangers can verify the ledger only because they can all see it. So when someone says a protocol is "encrypted", ask which of three things they mean, because the answer decides what is actually protected.
In plain English
A sealed envelope hides what's inside (encryption). A fingerprint identifies you without letting anyone rebuild your hand (hash). A signature proves the letter came from you without hiding a word of it. A blockchain is a public noticeboard of signed letters — nobody can forge one, and everybody can read it.
02 · Mechanics
- Hash function. Any input goes in, a fixed-size output comes out. Bitcoin uses SHA-256; Ethereum uses Keccak-256. Change one bit of the input and the output is unrelated. Hashes link each block to the last, build the Merkle trees that summarise thousands of transactions in one number, and turn a public key into an address.
- . Your signs a message; anyone can check the signature against your public key without learning the private key. Bitcoin and Ethereum use ECDSA over the secp256k1 curve; Solana uses Ed25519. This is what "authorising a transaction" physically is.
- Symmetric and asymmetric encryption. These live around the chain, not on it: the TLS session between your browser and an app, and the password-protected file your wallet uses to store your key on disk. A wallet typically stretches your password into a key with a slow function like scrypt or PBKDF2, then encrypts the private key with AES.
- Kerckhoffs's principle. Security must rest on the secrecy of the key, never of the algorithm. Every algorithm above is public and heavily studied; that is why they can be trusted.
03 · Formulas
hash(m) → h one-way; same m always gives same h; any change → unrelated h
sign(m, sk) → σ only the holder of sk can produce σ
verify(m, σ, pk) → ✓/✗ anyone can check; no secret is revealed
encrypt(m, k) → c decrypt(c, k) → m // reversible, needs the key
// strength is measured in bits of search space
entropy_bits = length × log₂(alphabet_size)
Worked through, because the arithmetic is the intuition:
A 128-bit key has 2¹²⁸ ≈ 3.4 × 10³⁸ possibilities.
A rig trying 10¹⁸ keys/second needs 3.4 × 10²⁰ s ≈ 10¹³ years. → not brute-forceable
An 8-letter lowercase password: 26⁸ ≈ 2.1 × 10¹¹ possibilities.
At 10¹⁰ guesses/second that is about 21 seconds. → trivially brute-forceable
That gap is the whole story of key-storage failures: the algorithm is fine, and the input fed to it was human-sized. A 12-word carries 128 bits of entropy and a 24-word one carries 256 — but only when the words are chosen by a random generator, not by a person.
04 · Edge cases & risks
- Randomness is a dependency, not a detail. Every key and every ECDSA signature consumes random numbers. Predictable or repeated randomness can expose the private key while every algorithm involved is used correctly.
- Hashing is not anonymising. Hashing a phone number, email or any low-entropy value hides nothing from someone who can simply hash every candidate and compare. See On-Chain Privacy.
- Quantum computers break signatures, not hashes. Shor's algorithm would break ECDSA and Ed25519 outright, while hashes only lose a fraction of their strength. NIST finalised its first post-quantum standards in August 2024, and migrating a chain's signature scheme is a coordination problem rather than a code change. Estimates for when a machine capable of this exists are contested; treat it as planning, not panic.
- You can sign what you cannot read. A signature proves you authorised the bytes, not that you understood them — the root of blind-signing losses. See Key Management.
A protocol advertises "military-grade encryption" for its on-chain transfers. On Ethereum, what does that encryption actually hide from a public block explorer?
A wallet file is protected by a password of 8 random lowercase letters (26 options per character). Roughly how many guesses does it take to try every possibility?