Cryptography · Foundational Principle

Kerckhoffs's Principle

The most important sentence in cryptography was written in 1883: a system must stay secure even when the enemy knows everything about it except the key. Every trustworthy cipher you use today obeys it. Every "secret sauce" cipher that ignored it is in a museum, a courtroom, or a CVE database.

01

The Principle in One Sentence

Kerckhoffs's Principle

A cryptosystem should remain secure even if everything about the system, except the key, is public knowledge.

Read it carefully, because it is stronger than it first appears. It does not say the algorithm may become public and you should survive that embarrassment. It says you should design from day one as if the algorithm were already published: the mathematics, the source code, the protocol, the block diagrams, all of it sitting on the adversary's desk. If the system is still secure in that scenario, the entire weight of your security rests on one small, manageable thing: the key.

The inverse approach (hoping the enemy never figures out how the system works) has a name too: security through obscurity. Obscurity can add a speed bump on top of real security, but the moment it is the foundation, you have built on sand, because a secret shared by every device, every developer, and every factory that ships your product is not a secret. It is a countdown.

02

1883: Six Rules for Military Ciphers

Auguste Kerckhoffs, a Dutch-born linguist and cryptographer teaching in Paris, published a two-part essay called La Cryptographie militaire in the Journal des sciences militaires in 1883. Military telegraphy was booming, and armies needed ciphers that survived real field conditions: captured codebooks, defecting clerks, stolen equipment. Kerckhoffs laid out six design requirements. The second one made him immortal.

#Kerckhoffs's Requirement (paraphrased)
1The system must be practically, if not mathematically, indecipherable.
2It must not require secrecy, and it must be able to fall into the enemy's hands without inconvenience.
3The key must be communicable and retainable without written notes, and changeable at the will of the correspondents.
4It must be applicable to telegraphic correspondence.
5It must be portable, and usable by a single person.
6It must be easy to use, demanding neither mental strain nor knowledge of a long series of rules.

Notice how modern the reasoning is. Rules 2 and 3 together form a complete security philosophy: assume the machinery is captured, and make the key the one thing you can change cheaply. An army cannot redesign its cipher machines mid-war, but it can issue new keys every morning. Substitute "firmware in a billion devices" for "cipher machines" and the argument has not aged a day.

Shannon's blunt restatement

Sixty-six years later, Claude Shannon (founding information theory and modern cryptanalysis more or less in the process) compressed Kerckhoffs's second rule into the form most working cryptographers quote:

The enemy knows the system. Claude Shannon · "Communication Theory of Secrecy Systems," 1949

Sometimes called Shannon's maxim, it is the same principle with the politeness removed. Design for the worst case, because at scale the worst case is simply the case.

03

The Principle in Action: AES

If you want to see Kerckhoffs's Principle operating in the real world, you do not need a hypothetical. You need only look at the cipher protecting this very page in transit: AES.

In 1997, when the U.S. government needed a replacement for the aging DES, it did something that would have seemed insane under a security-through-obscurity worldview: it asked the entire planet to submit ciphers, published every submission in full, and invited the world's cryptographers to spend three years tearing them apart in public. The winner, Rijndael, designed by Belgian cryptographers Joan Daemen and Vincent Rijmen, became AES in 2001. Its complete specification (every constant, every table, every step) is a free download. There has never been a secret to leak.

And that is precisely why it is trusted with everything from your bank session to classified government traffic:

Your TLS connections, your device's disk encryption, and your Wi-Fi all lean on this publicly documented algorithm every day. The full tour of where AES lives, and how it has held up, is on the AES page; the round-by-round machinery is in Block Ciphers and AES.

Kerckhoffs-compliant design versus security through obscurity Two panels. Left: AES, public algorithm with a small replaceable secret key, marked as still standing since 2001. Right: GSM's A5 ciphers, secret algorithm baked into hardware, marked as reverse engineered and broken. AES KERCKHOFFS-COMPLIANT ALGORITHM: PUBLISHED 2001 attacked openly for 20+ years SECRET: KEY ONLY key leaks → rotate it → system survives STATUS: STILL STANDING GSM A5/1 & A5/2 SECURITY THROUGH OBSCURITY ALGORITHM: KEPT SECRET (1987) no public review, baked into hardware SECRET: THE ALGORITHM ITSELF leaked → broken → cannot rotate hardware STATUS: REVERSE ENGINEERED, BROKEN
Figure 1 — Two philosophies, two outcomes. The public algorithm outlived the secret one by design, not by luck.
04

The Cautionary Tale: GSM's Secret Ciphers

The contrast case that makes the principle vivid comes from the phone in your pocket's ancestors. When the GSM cellular standard was designed in the late 1980s, its voice-encryption ciphers, A5/1 (the strong version) and A5/2 (a deliberately weakened export version), were kept confidential. Security rested partly on the hope that nobody outside the consortium would ever learn how they worked.

Everybody learned how they worked.

Here is the Kerckhoffs lesson in one line: the secrecy was load-bearing, and it was welded to the hardware. When the algorithms leaked, there was no key to rotate; the broken cipher was burned into hundreds of millions of handsets and base stations across the globe. Fixing the mistake meant decades of infrastructure turnover, not a Tuesday patch.

The graveyard has more headstones

GSM is not an isolated incident; it is the pattern. The DVD industry's secret CSS scrambling system was reverse engineered in 1999 (the famous DeCSS episode) and its 40-bit design fell instantly. NXP's MIFARE Crypto-1, the secret cipher inside hundreds of millions of transit and building-access cards, was reverse engineered from the chip itself in 2007–2008 and broken within months; entire fare systems had to be replaced. Every one of these systems shared the same architecture: the algorithm was the secret, the secret leaked, and there was nothing left to rotate.

Field Rule

Treat any vendor whose security pitch depends on a proprietary, unpublished, "military-grade secret" algorithm as pitching you a vulnerability with a countdown timer attached. Real confidence comes from surviving public review, not avoiding it.

05

Why Obscurity Always Loses at Scale

It is worth being precise about why the pattern repeats, because "obscurity is bad" is a slogan, and slogans do not survive contact with a persuasive vendor. The mechanics:

None of this means you must volunteer your network diagrams to strangers. Not advertising internal details is ordinary hygiene, and defense in depth welcomes every extra layer, obscurity included. The principle draws a sharper line: obscurity may garnish your security. It must never be your security.

06

What the Principle Demands of You

Kerckhoffs's Principle is not trivia; it is a working checklist you will apply for the rest of your career, well beyond ciphers:

SituationThe Kerckhoffs Question
Choosing cryptoUse published, standardized, publicly reviewed algorithms (AES, ChaCha20, SHA-2/3, the NIST post-quantum suite). Never invent, never accept "proprietary."
Writing softwareAssume your source code will leak. If reading it would compromise security, secrets are in the wrong place. Config, credentials, and API keys belong in a vault, not the repo.
Designing systemsEvery secret in the design should be small, rotatable, and per-deployment: keys, tokens, passwords. If a secret cannot be changed after compromise, redesign until it can.
Evaluating vendors"Our algorithm is confidential" is a red flag, not a feature. Ask what public standards they build on and what independent review they have survived.
Hiding detailsFine as an extra layer (nonstandard ports, unadvertised endpoints), but only on top of a system that would still hold if the details were published tomorrow.
07

What to Take Forward

Before leaving this page, confirm you can answer the following without looking:

  1. State Kerckhoffs's Principle in one sentence, and Shannon's maxim in five words.
  2. Why must the key, rather than the algorithm, carry the secrecy in a well-designed system?
  3. How does AES's history demonstrate the principle paying off in practice?
  4. What happened to GSM's A5 ciphers, and why was recovery so expensive?
  5. Where is the legitimate (and illegitimate) place for obscurity in a security design?

If all five are solid, you now hold the single idea that separates trustworthy cryptography from theater. Carry it into AES if you arrived here first, or onward through the rest of the symmetric track.