How Crypto Security Actually Works
Before you can make intelligent decisions about hardware wallets, seed phrase storage, or DeFi security, you need to understand what you're actually protecting and why the math makes it worth protecting.
Video Narration: Q3 2026
Video narration arrives Q3 2026. Full written lesson available below.
Public and Private Key Cryptography
Every Bitcoin address and every Ethereum address starts with a single number: a 256-bit random integer called the private key. You can think of it as a number between 1 and 2^256 - a range so large that randomly guessing someone's private key is more improbable than picking a specific atom out of all matter in the observable universe.
From that private key, a corresponding public key is derived using elliptic curve multiplication on the secp256k1 curve. This is a one-way mathematical operation: given the private key, computing the public key takes milliseconds. Given only the public key, computing the private key would take more time than the current age of the universe on every computer on Earth working simultaneously.
Your wallet address is then derived from the public key by running it through two hash functions (SHA-256, then RIPEMD-160 for Bitcoin; Keccak-256 for Ethereum) and encoding the result. The address is what you share publicly. The private key is what you never share.
Key derivation chain
The word "cryptography" gets thrown around loosely in crypto. What it actually means here is: the security of your funds rests entirely on one premise - that no one can reverse the elliptic curve function to derive your private key from your public address. So far, no classical computer has come close to breaking this. More on quantum computers in Module 6.
The practical implication: your address is safe to share. Your private key is not safe to share with anyone, ever, under any circumstance. Ledger support will never ask for it. MetaMask will never ask for it. There is no legitimate reason for any person or system to need your private key directly.
Seed Phrases and HD Wallets
Managing a raw 256-bit private key - a string of 64 hexadecimal characters - is error-prone. In 2013, the Bitcoin community proposed BIP-39 (Bitcoin Improvement Proposal 39), which encodes private key entropy as a sequence of English words. This is what became the standard seed phrase, also called a recovery phrase or mnemonic.
How BIP-39 Works
The BIP-39 standard uses a fixed wordlist of 2,048 English words. Because 2^11 = 2,048, each word encodes exactly 11 bits of information. The math works like this:
12 words
128 bits of entropy + 4-bit checksum
24 words
256 bits of entropy + 8-bit checksum
The checksum is the first bits of the SHA-256 hash of the entropy. This is why wallets can detect if you mistype a word.
128 bits of entropy from a 12-word phrase is already beyond brute-force with any conceivable classical computer. 24 words provide 256 bits, which doubles the exponent. Most hardware wallets default to 24 words. Both are effectively equivalent in security terms for the foreseeable future.
The most important thing to understand about your seed phrase: it IS your wallet. Not a backup of your wallet. Not a recovery key for your wallet. The seed phrase is the wallet itself. Anyone who has your seed phrase has complete, permanent, irrevocable access to every address and every asset that wallet has ever controlled or will control.
HD Wallets and Derivation Paths
BIP-32 defined Hierarchical Deterministic (HD) wallets, and BIP-44 standardized the derivation path structure. Instead of one seed phrase per private key, one seed phrase generates a tree of deterministic key pairs - potentially millions of addresses across hundreds of blockchains, all from the same 24 words.
The derivation path encodes which address you're using:
BIP-44 derivation path structure
m / purpose' / coin_type' / account' / change / address_index
m/44'/0'/0'/0/0First Bitcoin account, first receiving addressm/44'/60'/0'/0/0First Ethereum account, first receiving addressm/44'/60'/0'/0/1Second Ethereum address, same accountm/44'/60'/1'/0/0Second Ethereum account entirelyThis structure is why you can restore your Ledger with a 24-word seed and see all your assets reappear - Bitcoin, Ethereum, Solana, everything. The same seed, applied to the correct derivation paths, always produces the same addresses. The blockchain is permanent; the seed phrase lets you reconstruct the keys that control it.
What the Blockchain Secures vs What It Doesn't
This distinction is where most security thinking goes wrong. The Bitcoin and Ethereum mainnets have never been hacked in the sense of the chain itself being compromised. Every transaction ever recorded remains immutable. The cryptographic foundation is intact.
What the blockchain secures: once a transaction is included in a block and sufficient blocks have been added on top (6 for Bitcoin, 12-15 for Ethereum), that transaction is effectively irreversible. No one can alter it, reverse it, or erase it. This is what "trustless" actually means: you don't need to trust any party because the math enforces finality.
Blockchain DOES protect
- Transaction immutability after confirmation
- Double-spend prevention
- The record of who owns what
- Smart contract execution as written
Blockchain DOES NOT protect
- Your private keys or seed phrase
- Your decision to approve a malicious contract
- Your browser session or clipboard
- Your choice to send funds to a scammer
- Bugs in the smart contract code
When $1.5 billion was stolen from Bybit in February 2025, the blockchain worked exactly as designed. The transactions were valid. The attacker had obtained the authorization to sign them through a supply chain attack on Bybit's wallet infrastructure. The chain recorded what happened accurately. The security failure was entirely off-chain.
This distinction matters for everything that follows in this course. Every attack covered in Module 4 - phishing, SIM swaps, clipboard hijackers, malicious approvals - targets the human and device layer, not the chain. Understanding where the security boundary actually lies is the prerequisite for every defense in Module 5.
Custodial vs Self-Custody
When you hold crypto on Coinbase, Binance, or Kraken, those companies hold the private keys. You have an account balance in their database. The "crypto" in your account is an IOU from the exchange backed by actual crypto they hold in their own wallets. If the exchange fails, is hacked, or freezes withdrawals, your account balance may be worthless.
When you hold crypto on a hardware wallet, you hold the private keys. The exchange or custodian has no claim over your assets. If Ledger goes out of business tomorrow, your Bitcoin is still yours because your seed phrase works with any BIP-39-compatible software. The hardware is just a secure place to store keys.
Custodial (exchange)
- Pros: easy recovery, no seed phrase risk, regulated insurance
- Cons: exchange risk (FTX), withdrawal freezes, KYC exposure
- Right for: active traders, small amounts, fiat on/off ramps
Self-custody (hardware wallet)
- Pros: full control, no counterparty risk, not tied to any company
- Cons: seed phrase loss = permanent loss, no password recovery
- Right for: long-term holds, significant amounts, privacy-focused users
The honest advice: most people should use both. Keep trading amounts on regulated exchanges. Move anything you're holding long-term to self-custody. The threshold is personal, but a common framework is: if losing the amount would materially affect your financial situation, it belongs in self-custody. If it's "walking around money" you might trade next week, an exchange is fine.
Encryption Standards in Crypto
Three algorithms underpin most crypto security. You don't need to implement them, but you need to know what each one does and where it's applied.
AES-256
Advanced Encryption Standard, 256-bit key
What it does: Symmetric encryption algorithm. The same key encrypts and decrypts.
Where it's used: Encrypting wallet files on disk, encrypting backups, protecting data at rest. Ledger Live encrypts local data with AES-256.
AES-256 has never been broken. A brute-force attack would require more energy than the sun produces in its lifetime.
SHA-256
Secure Hash Algorithm, 256-bit output
What it does: One-way hash function. Any input produces a fixed 256-bit output. Reversing it is computationally infeasible.
Where it's used: Bitcoin address generation, Bitcoin mining (proof-of-work), transaction ID generation, BIP-39 checksum calculation.
Bitcoin uses SHA-256 twice (double-SHA-256) for mining and transaction IDs as an additional security measure.
ECDSA
Elliptic Curve Digital Signature Algorithm
What it does: Uses the private key to produce a cryptographic signature on a transaction. The signature proves you authorized the transaction without revealing the private key.
Where it's used: Every on-chain transaction. When you 'sign' a transaction, your hardware wallet uses ECDSA with your private key to produce a signature that any node can verify using your public key.
This is why hardware wallets can verify transactions without exposing your private key: the signing happens inside the secure element.
These three algorithms work together: your seed phrase is protected by AES-256 when stored in a Ledger Live vault. Your address is derived using SHA-256. Your transactions are authorized using ECDSA. The security of the entire system depends on none of these being broken - and none of them have been broken by classical computers. The quantum risk to ECDSA is real but measured in decades, not years. Module 6 covers this in detail.
The Trust Chain: How Firmware Verification Works
The previous section ended with a claim worth examining: your private key never leaves the secure element. That claim only holds if the firmware running on that secure element is the firmware the manufacturer actually signed. Modified firmware could leak signatures, weaken random number generation, or show the wrong destination address on screen while signing a different one. Every reputable hardware wallet defends against this with a chain of trust anchored at the factory.
The manufacturer holds a private signing key offline in a hardware security module. Every firmware release is signed with that key. The corresponding public verification key is burned into the device bootloader at the factory. When you flash a firmware update through Ledger Live, Trezor Suite, or Keystone Studio, the device does not simply accept the binary. The bootloader checks the signature against the embedded public key before executing a single instruction. A signature mismatch and the firmware refuses to load.
Firmware trust chain
Some manufacturers go further. Trezor publishes the entire firmware source code and Docker-based reproducible build instructions. Anyone can compile the firmware themselves and verify the resulting binary hash matches what Trezor distributes. As of 2026, Trezor, Keystone, and BitBox all support reproducible builds. Ledger does not, because BOLOS, the operating system that runs on Ledger devices, is closed source. Ledger instead relies on its Genuine Check protocol: when you connect a Ledger device, Ledger Live challenges it to prove possession of an attestation certificate signed by Ledger and provisioned at the factory. A counterfeit device cannot produce a valid response.
Both approaches solve the same problem with different trust models. Open firmware lets you verify the source matches the binary. Closed firmware with attestation lets you verify the device matches what the manufacturer shipped. Neither approach is inherently weaker. Both depend on the manufacturer signing key staying secure. The threat model that breaks both is the same: a compromise of the manufacturer signing infrastructure. That has not happened to a major hardware wallet vendor as of 2026.
Counterfeit Devices and Supply Chain Attacks
The most common hardware wallet attack does not break the cryptography. It bypasses the trust chain entirely by getting a compromised device into the user's hands before they ever turn it on. Counterfeit hardware wallets sold through third-party marketplaces have arrived pre-loaded with seed phrases the attacker generated and recorded. The buyer powers on the device, sees a valid seed phrase, transfers funds in. The attacker, who has been holding the recovery phrase since manufacture, drains the wallet on the first meaningful deposit.
These attacks have been documented on Amazon third-party listings, eBay, and through cloned versions of less-established brands between 2018 and 2024. The pattern is consistent: the device looks identical to the genuine article, the packaging looks legitimate, and the firmware reports as valid because the trust chain depends on the bootloader public key. A skilled counterfeiter can replicate the visible parts. They cannot replicate the manufacturer signing key, which is why the device defenses described above ultimately work. But that protection only kicks in if the user does something the counterfeit version cannot pass.
Two rules that defeat this attack
Buy direct from the manufacturer
ledger.com, trezor.io, keyst.one, and the equivalent direct sites for every wallet covered in Module 2. Never Amazon third-party, eBay, or any reseller you cannot verify. The price difference between an authorized retailer and the manufacturer is small. The risk difference is total.
Never accept a pre-existing seed
A genuine hardware wallet generates its seed phrase the first time it powers on, in front of you, on its own screen. If a device arrives with a printed recovery phrase in the box, displays an already-generated seed on first boot, or asks you to enter a pre-supplied phrase to "activate" it, throw it out. That device is compromised. No exceptions, no recovery, no "maybe it is fine."
Ledger and Trezor both run Genuine Check or attestation routines on first connection. Both will warn you if a device fails verification. But the second rule above does not depend on either company's tooling. It depends only on the user understanding that a fresh device must generate a fresh seed. That single piece of knowledge defeats the most common hardware wallet compromise in the wild.
Knowledge Check
Module 1 - 8 questions
What is secp256k1, and why does it matter for Bitcoin and Ethereum?
A 12-word BIP-39 seed phrase provides how many bits of entropy?
What does the Bitcoin and Ethereum blockchain actually protect against?
What is the BIP-44 derivation path for the first Ethereum account on a standard hardware wallet?
What is the main security trade-off of using a custodial exchange like Coinbase or Binance versus a hardware wallet?
SHA-256 and AES-256 both have '256' in the name. What is the key difference between them?
How does a hardware wallet verify that the firmware it is running was actually built by the manufacturer?
What is the most common hardware wallet attack, and what single user behavior defeats it?