Learn
Articles on the cryptography behind cipher.ink, with working examples and the real code.
These articles explain the cryptography cipher.ink runs, from the cipher itself to the browser features around it, and the history that got us here. Where a number matters, we computed it. Where a claim is about our own site, it comes from the code you can read yourself. Start with the technologies if you want to know what's inside a sealed message, or with the practical guides if you just need to send something safely today.
Technologies we use
What is inside every message, and why we chose it.
- AES-GCM, explainedThe mode that seals every cipher.ink message, how its tag works, and the one rule you must never break with it.
- PBKDF2, and why we run it 600,000 timesHow a passphrase becomes a key, worked by hand, and the arithmetic behind the iteration count.
- How AES works, round by roundHow the cipher under every cipher.ink message scrambles 16 bytes, with the standard's own worked numbers.
- Why the URL fragment (the part after #) never reaches the serverHow a secret link keeps its key away from the server that stores the message, shown with a real request, and every place the fragment does leak.
- Burn after reading: how it works hereWhat "deleted" means for cipher.ink exactly, why a link preview can't burn a message, what happens with two readers at once, and what no website can promise.
- AES-OFB in Web Crypto: how we decrypt 2016 messagesWeb Crypto has no OFB, but CBC applied to zero blocks gives exactly the OFB keystream. The proof, the numbers, the test, and how weak the old format was.
- Modulo bias: the bug in most password generatorsOur own passphrase generator could never choose 32 of its 288 words. The before-and-after code, the exact cost in bits, and rejection sampling.
- Content-Security-Policy, explained with a real oneOur exact header, directive by directive, what Chrome actually logs when it blocks an attack, and how to test your own policy.
- Client-side, end-to-end and at-rest encryptionFour things people call "encrypted", who can read what in each, where cipher.ink sits, and the one trust no web tool can remove.
- The three-pass protocolShamir and Massey-Omura: how two strangers can send a secret with no key exchanged, why XOR fails, why exponentiation works, and why nobody uses it.
- Block cipher modes of operation: ECB, CBC, CTR, OFB and GCMWhy a good cipher in a bad mode leaks, with the ECB picture demo on your own image, a diagram of each mode and a table to choose from.
- Authenticated encryptionFlip one bit and "pay $100" becomes "pay $900". Then watch AES-GCM refuse it: encrypt-then-MAC, AEAD and the rules for using them.
- What a hash function is, and is notPreimage, second-preimage and collision resistance in plain words, the birthday bound computed, and how MD5 and SHA-1 were broken.
- How SHA-256 works, step by stepThe standard's "abc" example worked through padding, the message schedule and the 64 rounds, with an explorer you can run on your own text.
- What is HMAC? A hash with a keySHA-256(key + message) falls to length extension, forged here on real numbers. How HMAC fixes it, and how to verify a tag.
- The Web Crypto APIWhat crypto.subtle offers and leaves out, why it beats a JavaScript library, a probe that tests your own browser, and our real sealing code.
- Password hashing: bcrypt, scrypt, Argon2 and PBKDF2Why a plain hash isn't enough, what memory-hardness buys against GPUs, current parameters, and why a browser tool still uses PBKDF2.
- Math.random vs crypto.getRandomValues: random numbers in the browserWhy Math.random is wrong for secrets, what the operating system generator does, and the bug our own 2016 code had.
- Sanitizing HTML you don't trustOur 22-tag allowlist and why each tag is on it, the link rule, three layers of sanitizing, mutation XSS and the test that attacks us.
- Unicode normalization: why "café" can be two passphrasesThe same word as two byte strings gives two different keys. NFC makes them agree, and there's an inspector for your own text.
- How Base64 works, byte by byteThree bytes become four characters. The explorer, the padding, why + and / break URLs, and the twenty lines of code we use.
- Read receipts without tracking pixelsWe count a read only when a message is decrypted, using a token hidden inside it. What that records, what it can't, and how pixels differ.
- The mathematics of Secret SantaDerangements, why the hat fails almost two times in three, why the usual fixes are unfair, one big loop, and how many draws your group has.
History
People, standards and mistakes that shaped modern cryptography.
- The history of AESFrom IBM's Lucifer and the 56-bit DES key to a three-year public contest, fifteen candidates and the Rijndael victory, with every date sourced.
- A short history of cryptographyFour thousand years in one read: counting letters, mixing alphabets, machines, mathematics and open contests, with a link to every cipher.
- How Enigma was broken: Warsaw, then Bletchley ParkRejewski's 1932 break, the 1939 handover, Turing and Welchman's bombe, the U-boat blackout and what the film leaves out, with dates.
- Public-key cryptography was invented twiceGCHQ found it in secret between 1969 and 1974. Merkle, Diffie, Hellman, Rivest, Shamir and Adleman found it in public. Both stories, dated.
- Kerckhoffs's principleThe 1883 rule that a cipher must survive the enemy knowing everything but the key, the six requirements and why we publish our code.
- Shannon and perfect secrecyWhat "impossible to break" requires, proved in 1945: the one-time pad worked in letters, the Venona failure, unicity distance, and why we settle for less.
- The Crypto WarsWho may use strong encryption, told in order: export rules, PGP's investigation, the Clipper chip, Bernstein v. US and today's lawful-access debate.
- Dual_EC_DRBG: a standard with a possible back doorHow a random-number standard could hide a back door, shown with a toy curve you can run, and the timeline from 2006 to NIST's withdrawal.
- Al-Kindi and the invention of frequency analysisThe ninth-century Baghdad treatise that taught the world to break ciphers by counting letters, with a worked example and a tool to try.
- The cipher that convicted Mary, Queen of ScotsPhelippes, the beer barrel and the 1586 plot, and how three researchers deciphered 57 more of Mary's letters in 2023.
- How the Zodiac 340 cipher was solvedA transposition hidden inside a homophonic substitution kept the 340 safe for 51 years, until Oranchak, Blake and Van Eycke broke it in 2020.
- The history of cipher.inkBuilt in 2016, broken for eleven weeks by a library update, rebuilt in a day, then slowed to a crawl by its own design. What we learned.
- Mental pokerShamir, Rivest and Adleman's 1979 answer to dealing cards over the phone, the leak Lipton found, and the Secret Santa nobody controls.
Practical guides
Things to do right now: send a password, check a download, pick a passphrase.
- How to send a password to someone securelyThe honest options, ranked, and a step-by-step way to send a password as a one-time link that burns after reading, with the passphrase sent separately.
- How to send sensitive documents (tax forms, IDs) without emailEncrypt files before they leave your device: attachments in a sealed message up to 5 MB, or an AES-256 archive for anything larger, with the key sent separately.
- How to verify a download's SHA-256 checksumThe Windows, Mac and Linux commands for checking a download against a published SHA-256, how to read a SHA256SUMS file, and why a signature proves more.
- How to make a strong passphrase you can rememberPick random words with dice or a generator and work out the entropy: six words from a 7,776-word list give 77 bits. A browser generator is included.
- How long would it take to crack my password?It depends on how strong the password is and how the site stores it: the same six-word passphrase takes 20,000 years against MD5 and 229 billion against PBKDF2.
- Is email encrypted?Email is usually encrypted between servers but not end to end, so your provider can read it. How STARTTLS, MTA-STS, S/MIME and PGP fit in, and what to do instead.
- What is end-to-end encryption?End-to-end encryption means only the sender and recipient hold the keys. How it differs from encryption in transit and at rest, safety numbers, and what it doesn't hide.
- Self-destructing messages: what they can and can't promiseWhat a self-destructing message can honestly promise, how messenger timers, one-time note sites and cipher.ink compare, and six questions to ask of any of them.
- Sharing a secret link by QR code safelyA QR code is only a link drawn as a picture. How to use the cipher.ink QR code for a secret, how shoulder surfing works, and how to scan other people's codes safely.
- Sending yourself an encrypted noteUse a sealed message as an encrypted note to yourself: the lock, the expiry, My messages, and where it stops being the right tool.
- How 2FA codes (TOTP) workHow the six-digit code in an authenticator app is made from a secret and the clock, with RFC 6238 worked through and a calculator that shows each step.
- What a password salt is, and why every password needs its ownA salt is a random value that makes identical passwords hash differently and defeats lookup tables. A pepper is a secret kept outside the database. Worked with real hashes.
- Secret Santa without collecting email addressesThe hat, a friend who draws for you, sealed links and a trustless protocol, with who can see the pairings in each.
- Secret Santa when couples are in the groupHow to stop partners and housemates drawing each other, how many draws are left, and when the rules make a draw impossible.
- How to run a Secret Santa for a remote teamA schedule worked back from the reveal, what the budget should include, how to handle home addresses, and what to do when someone vanishes.
- Secret Santa rules worth settling before the drawBudget, dates, who can't draw whom, dropouts, late gifts and when the secret ends.