What is encryption?
Encryption turns readable data into scrambled text using a key, and the right key turns it back. Symmetric encryption uses one shared key, while public key encryption uses a matched pair. Unlike hashing, encryption can be reversed. Bitcoin's ledger is not encrypted at all: encryption protects your connection to an exchange and the wallet files that hold your keys.
Nội dung này hiện chỉ có bản tiếng Anh.

Take the message MEET AT NOON and move every letter three places along the alphabet. M becomes P, E becomes H, T becomes W. The message now reads PHHW DW QRRQ.
Anyone who knows the rule "shift by 3" can move each letter back and read it. Anyone who does not sees nonsense. That is encryption in one of its oldest forms.
Plaintext, ciphertext and the key
Encryption turns readable data into scrambled data using a secret value called a key. Decryption uses a key to turn it back.
The readable version is the plaintext, here MEET AT NOON. The scrambled version is the ciphertext, PHHW DW QRRQ. The method is called the cipher, and the number 3 is the key.
Modern ciphers keep this structure. The method is published for anyone to study, and only the key is secret. If the method is sound, knowing exactly how it works gives an attacker nothing without the key.
Why the shift cipher fails
The shift cipher has only 25 useful keys. An attacker can try all 25 by hand in a few minutes and stop at the one that reads as normal text.
Modern ciphers fix this with enormous keys. AES, a widely used modern cipher, takes keys of 128, 192 or 256 bits.
A 256-bit key has 2 to the power of 256 possible values, a number 78 digits long, so trying them all is out of reach.
Attackers therefore go after the key itself. Very often that key is protected by a password a person chose, and passwords are much easier to guess.
Worked example: how long a password lasts
The numbers here are for illustration. Assume an attacker can test 1 billion passwords per second, and that each password was picked at random.
- Eight lowercase letters: 26 choices per character, so 26 to the power of 8, about 209 billion options. At 1 billion a second, every option is tried in about 209 seconds, roughly 3.5 minutes.
- Twelve characters drawn from lowercase, capitals and digits: 62 choices per character, so 62 to the power of 12, about 3.2 × 10²¹ options. At the same speed that takes about 3.2 × 10¹² seconds, roughly 100,000 years.
Real guessing speed depends on how the password is stored, and passwords people invent are far weaker than random ones. The pattern still holds: length and randomness are what protect an encrypted file.
Symmetric encryption: one shared key
The shift cipher and AES are both symmetric: the same key locks and opens the data. Symmetric ciphers are fast, so they guard large amounts of data, such as a laptop disk or your browser's traffic to a website.
The weak point is sharing the key. If you and a stranger want to talk privately over the internet, you cannot send the key in plain view, because anyone watching could copy it.
Public key encryption: a matched pair
Public key encryption, also called asymmetric encryption, solves that with two keys made as a pair. Data locked with the public key can only be opened with the matching private key.
You can publish the public key anywhere. Anyone can use it to send you a locked message, and only you, holding the private key, can read it. RSA is a well-known example.
Public key methods are slow, so real systems use both kinds. When you open a crypto exchange website, your browser uses public key methods to agree a fresh symmetric key with the server.
From then on, the visit runs on fast symmetric encryption with that shared key.
Key pairs do a second job in crypto: proving who approved a transaction. Public and private keys covers how the pair is made, and digital signatures covers how it signs.
Is Bitcoin encrypted?
No. Every Bitcoin transaction, amount and address sits on a public ledger that anyone can read. The "crypto" in cryptocurrency refers to cryptography as a whole, and Bitcoin relies on hashing and signatures far more than on encryption.
Privacy coins hide amounts or addresses with extra cryptographic techniques, which the privacy coin lesson explains. On Bitcoin, anyone who links an address to you can read its whole history.
Encryption still guards you at two points. Your connection to an exchange or wallet service is encrypted in transit. Many wallet apps also encrypt the keys they store on your device with your password or PIN.
If you forget the password to an encrypted wallet file, nobody can reset it for you. Your way back is the wallet's seed phrase, which is why it must be written down and kept safe.
Encryption and hashing are easy to mix up, so here they are side by side.
| Encryption | Hashing | |
|---|---|---|
| Can it be reversed? | Yes, with the key | No |
| Does it use a key? | Yes | No |
| Output length | Grows with the input | Always the same |
| Typical job | Keep data secret | Fingerprint data |
Câu hỏi thường gặp
What is the difference between encryption and hashing?
Encryption can be reversed by anyone holding the right key. Hashing has no key and no way back: the only attack is to guess inputs and compare the hashes.
Can strong encryption be cracked?
A modern cipher with a long random key cannot be broken by guessing in any realistic time. Real attacks go after weak passwords, stolen keys and malware on the device instead.
Are Bitcoin transactions encrypted?
No. They are public and anyone can read them. They are protected by digital signatures, which prove the owner approved them without hiding anything.
What happens if I forget my wallet password?
In a wallet you control yourself, the encrypted file stays locked and no company can reset it. If you still have the seed phrase, you can restore the wallet on a new device and set a new password.
Học tiếp
Chương 3What is hashing?Hashing feeds data into a hash function, which returns a short code of fixed length called a hash. The same input always gives the same hash, a tiny change gives a completely different one, and there is no practical way to work back from the hash to the input. Bitcoin uses SHA-256 hashes to link blocks and name transactions.
Chương 3How does hashing work, and what is it used for?A hash function pads its input, cuts it into blocks of equal size and mixes each block into a running state over many rounds of bit operations. The final state is the hash. Crypto uses this to check files, store passwords, chain blocks together, summarise transactions in a Merkle root, build addresses and set the puzzle that miners solve.
Chương 3Public and private keys explained.A private key is a large random number that only you should know, and it signs your transactions. A public key is calculated from the private key and can be shared freely, so others can check your signatures and send you coins. The calculation only runs one way, so a public key never reveals the private key behind it.
Chương 3How do digital signatures work?A digital signature is a number calculated from a message and a private key. Anyone with the matching public key can check it. If the check passes, the message came from whoever holds the private key and has not changed by a single bit. Bitcoin nodes run this check on every transaction before they accept it.
Chương 3How does a Bitcoin transaction work?A Bitcoin transaction spends earlier unspent outputs as its inputs, proves you may spend them with a signature, and creates new outputs: one for the person you pay and usually one returning change to you. Whatever the inputs hold beyond the outputs is the fee. Nodes check the transaction, and a miner adds it to a block.