How Does a Lock Know Your Key? | How It Works Inside #08
Short answer
- A key's peaks and valleys lift five two-part pins so every gap lands on the shear line; if even one is off, the plug won't turn.
- With 5 pins and 10 depths there are 100,000 keys, but pins bind one at a time, cutting that to at most 50 checks.
- Newer locks fight back with spool pins, dimple keys with more pins, and rotating discs that use no spring-loaded pins.
Also calledhow a lock workspin tumbler lockhow keys worklock cylinderhow lock picking works
Video
Pressing play loads the YouTube player on this page. Watch on YouTube
Explained
In the video
- 0:00Two keys: one turns, one won't
- 0:28Inside: two cylinders and five pairs of pins
- 1:11The right key lines up every gap
- 1:48A wooden ancestor, thought to date back 4,000 years
- 2:27Which pins stop the look-alike key?
- 3:11How many different keys?
- 3:53The weak spot: one pin at a time
- 5:16Three newer designs, three weak spots
- 6:24In Japan: a law and a five-minute test
- 7:08Your own key's peaks and valleys
The diagrams in this article show a typical pin tumbler lock, the kind found on front doors around the world. They are schematics: the number of pins, the number of cut depths and all sizes are examples chosen for clarity, not the specs of any real product. Gaps and offsets are exaggerated so you can see them.
In the video you can watch the pins move in 3D as the key slides in. Here we go back over the same mechanism step by step, and add the math, the history and the newer designs that the video only had time to touch on.
The whole idea in 30 seconds

- The lock cylinder has two parts: an inner plug that turns with your key, and an outer housing (shell) that never moves.
- Five stacks of two-part pins sit across the boundary between them, the shear line, and keep the plug from turning.
- The right key lifts each stack to exactly the height where the gap inside it lands on the shear line. Then, and only then, the plug turns.
- If even one stack is too high or too low, a pin still straddles the line and the plug stays put.
- The weak spot: tiny manufacturing errors let someone test the pins one at a time. Newer locks each target a specific weakness.
What's inside the cylinder
The round brass face you see on a door is the front of the plug. The keyway, the shaped slot your key slides into, runs through the plug.

In the video we called the parts by color, because names like "key pin" are easy to mix up with "key" when you hear them. Here is how the two sets of names match up.
| In the video | Proper name | What it does |
|---|---|---|
| Gold cylinder | Plug | Turns with the key |
| Silver housing | Shell | Fixed in the door; never moves |
| Blue pin | Driver pin | Pushed down by a spring; blocks the plug |
| Copper pin | Key pin | Touches the key; length differs per hole |
A small spring sits above each driver pin and keeps the stack pressed down. The boundary between plug and shell is the shear line, shown in white.
From key in to key turning

The tip of the key lifts the pins
As the key goes in, its sloped tip slides under each pin stack and pushes it up. Past each peak on the key's edge, the stack drops again. The pins bob up and down as the peaks and valleys pass underneath.
All five gaps reach the line
Once the key is fully in, each stack stops at a height set by the depth of the cut beneath it. The key pins are all different lengths, and only a cut of exactly the matching depth puts the gap between key pin and driver pin right on the shear line.
Cryptographer Matt Blaze, in his paper on mechanical locks, describes it the same way: the plug turns only when the key aligns every pin stack's gap with the shear line, and it won't turn if a stack is lifted too little or too much. In the video's example, the key's cut depths are 3-6-2-7-4 (a bigger number means a deeper cut).
Only the plug turns
With every gap on the line, nothing crosses the boundary anymore, and the plug rotates. The driver pins stay up in the shell; the key pins ride around with the plug. The peaks and valleys on a key aren't decoration. They are five answers, one height for each pin.
From a 4,000-year-old wooden lock to today's key

Dropping pins into a bolt to hold it shut is a very old idea. The Lemelson-MIT program writes that the basic concept was used in ancient Egypt about 4,000 years ago, in large wooden locks. The Japanese security company ALSOK describes how such a lock worked: holes in a wooden bolt, with pins that drop into the holes to lock it and are lifted out to unlock it. Some accounts date these locks to around 2000 BC, so we say "thought to date back about 4,000 years."
The Museo Egizio in Turin, Italy, holds wooden lock parts from the New Kingdom period (about 1539–1076 BC, more than 3,000 years ago); a photo is available on Wikimedia Commons under CC0. The museum record doesn't say whether those parts are of the pin type, so the video explains the mechanism with a schematic model instead.
Fast-forward to June 27, 1865: U.S. Patent No. 48,475, granted to Linus Yale Jr., shows pin tumblers arranged in a cylinder that will only turn once the key has lined all of them up. The key is described as "a thin slip of steel." ALSOK notes that the pin tumbler lock was developed in the United States in the 1860s, and that the single pin of the Egyptian lock had become a pin split in two, with the lock opening when that split lines up with the shear line.
Linus Yale Sr. also built locks on the same principle, so we don't call his son "the inventor" or the patent "the first."
Where the look-alike key fails

In the video's puzzle, the look-alike key differs from the right key in just two places.
| Pin | Right key (3-6-2-7-4) | Look-alike (3-4-2-9-4) | What happens |
|---|---|---|---|
| 1 | ○ | ○ | Lined up |
| 2 | ○ | ×↑ | Cut 2 steps too shallow: lifted too high; the key pin straddles the line |
| 3 | ○ | ○ | Lined up |
| 4 | ○ | ×↓ | Cut 2 steps too deep: not lifted enough; the driver pin straddles the line |
| 5 | ○ | ○ | Lined up |
Too shallow, and the key pin itself ends up blocking the line. Too deep, and the driver pin is still in the way. Either way the plug is stuck. One wrong cut is enough.
How many different keys are there?
The numbers multiply
Every extra pin multiplies the number of possible keys by the number of depths. Blaze notes that most locks typically have four to seven pins and four to ten depths, with better locks tending to have more. Some have more than that.
| Pins | 4 depths | 7 depths | 10 depths |
|---|---|---|---|
| 4 | 256 | 2,401 | 10,000 |
| 5 | 1,024 | 16,807 | 100,000 |
| 6 | 4,096 | 117,649 | 1,000,000 |
| 7 | 16,384 | 823,543 | 10,000,000 |
The video uses 5 pins × 10 depths = 100,000 combinations as its example.
Neighboring cuts can't differ too much
In practice, two neighboring cuts can't be too different in depth, or the key gets fragile and the pins can't climb the slope between them. Blaze gives the example of a system with 7 depths where neighbors may differ by at most 4 steps. Under that rule, only 10,483 of 16,807 five-pin keys (about 62%) are usable, and 65,449 of 117,649 six-pin keys (about 56%). We checked these counts by brute force.
Make enough locks, and you run out
Even with 100,000 combinations, a company that made a million locks of the same design would, on average, use each combination ten times (a made-up example to show the scale).
Japanese lock maker Miwa Lock says that one reason it retired older cylinder designs was that "with so many being made, they exceeded the limit of available key combinations" (in Japanese), along with the need for better security. It recommends switching to designs with more combinations.
Published figures for newer designs
Lock makers publish "theoretical" combination counts for newer designs. Two Japanese companies list, for example:
- Miwa Lock JN cylinder (a pin cylinder with many pin tumblers set in from four directions): about 17.2 billion
- Miwa Lock U9 cylinder (locking bar with rotating tumblers): about 150 million
- Goal V18 cylinder (a dimple key design): 12 billion
These come from different companies and different products, counted under different conditions, so we don't rank them against each other.
The weak spot: why the pins can be tested one at a time

Blaze explains that lock picking exploits "small manufacturing imperfections and mechanical tolerances," and that it is much harder against good locks, especially those designed to resist it.
A 2025 U.S. patent (US 12,473,748 B1) describes what happens: when turning force is applied to the plug, imperfections and real-world tolerances mean the pin stacks aren't perfectly in line, so one driver pin gets pinched between plug and shell first. When that one pin reaches the shear line, the plug turns slightly and the next driver pin binds.
That tiny turn acts as a signal: "this pin is done." If each pin can be tested separately, the way you count changes:
- All at once: 10 × 10 × 10 × 10 × 10 = 100,000 combinations
- One at a time: 10 + 10 + 10 + 10 + 10 = at most 50 checks (27.5 on average)
- With six pins: 1,000,000 combinations versus at most 60 checks
This is a way to think about the numbers, not how long it actually takes. The binding order shown in the video (2 → 4 → 1 → 3 → 5) is a randomly generated example; real locks won't all bind in that order.
Newer designs, and the weakness each one targets
Spool pins and the fake signal
Targets: pins being tested one at a time. A spool pin is a driver pin with a narrow waist. According to the same 2025 patent, the idea is for its lower flange to catch on the shell so it hangs up across the shear line. The hobbyist site BosnianBill's LockLab calls the result a "false set": the waist slips into the shear line, the plug turns a little as if it's about to open, and then it stops. This time the lock is the one giving a fake signal. The patent also notes that a skilled person can sense spool pins and get past them.

Dimple keys with more pins
Targets: running out of combinations. A dimple key has round dimples on its flat faces instead of cuts along its edge. ALSOK describes the dimple key as a kind of pin tumbler lock that uses more pins and is said to resist picking well. More pins multiply the combinations again; Goal lists 12 billion for its V18 dimple key cylinder.
Rotating discs instead of spring-loaded pins
Targets: the binding weakness itself. In a rotating disc lock, the maker ABLOY explains, turning the right key 90 degrees rotates a stack of discs until the notches on their sides line up, and a locking bar drops into the notches so the cylinder can turn. ASSA ABLOY writes that "there are no pins, counter-pins or springs to exploit." The design was invented in the early 20th century by Emil Henriksson in Finland. The particular weakness described above, spring-loaded pins binding one at a time, simply isn't present. That doesn't mean such locks can't be opened.
Magnetic rotors
Some systems add magnetic rotors inside the cylinder that the magnets in the key must turn to the correct orientation, such as EVVA's MCS system from Austria.
In Japan: a law and a five-minute test
In Japan, the 2003 "Act on Prohibition of Possession of Special Lock-Opening Tools" (Act No. 65 of 2003, promulgated June 4, 2003) defines picking tools as devices for turning a cylinder "without using a key and without destroying it," and bans carrying them without a work-related or other legitimate reason (Article 3). It also asks lock manufacturers and importers to work on improving security (Article 6).
According to the Tokyo Metropolitan Police Department, in November 2002 a council of government ministries, including the National Police Agency, and industry groups began testing door and window parts with tools, and certifying those that met a security standard. Miwa Lock's glossary describes the council as the National Police Agency, the Ministry of Land, Infrastructure, Transport and Tourism, the Ministry of Economy, Trade and Industry, and building-parts industry associations. The Osaka Prefectural Police explain that a common "CP" mark (for "Crime Prevention") was introduced in May 2004, and that the test is based on a survey finding that "if a break-in takes five minutes or more, 70% of burglary suspects give up." The police page also states plainly that the mark does not guarantee five minutes of protection in every situation.
One Japanese lock maker, Miwa Lock, says older cylinders are easier targets for picking, and advises replacing older cylinders and adding a second lock to the same door.
A good lock isn't one that can never be opened. It's one that takes a long time to open.
Frequently asked questions
Why does a copied key open the lock just like the original?
The lock only checks the height of the peaks and valleys at each pin position. A key cut to the same heights lifts the same pins to the same heights, so it turns the plug just like the original.
Can a dimple key still be picked?
Designs like dimple keys and spool pins make picking much harder, but not impossible. The patent on spool pins notes that skilled people can get past them. In Japan, even the CP mark is described as not a guarantee.
Could the same key open someone else's door?
The number of combinations is limited. In our made-up example, a design with 100,000 combinations made a million times would repeat each combination ten times on average. Japanese maker Miwa Lock has said that exceeding the limit of key combinations was one reason it retired older designs.
What should I do about an old lock?
That depends on your door and where you live, so ask a locksmith. For one example of the advice given in Japan, see the section above.
Shorts
Sources
Where the facts and numbers in the video and on this page come from.
References
- U.S. Patent US 12,473,748 B1, "Segmented Lock Pin" (2025)
- Drawing: U.S. Patent 48,475 (1865), public domain.
- Calculations: this episode's own calculation script (combinations, neighbor limit, one-at-a-time counts, example binding order).
Links
- Matt Blaze, "Cryptology and Physical Security: Rights Amplification in Master-Keyed Mechanical Locks," IEEE Security and Privacy, 2003 (preprint Sept. 15, 2002, revised Mar. 2, 2003), sections 2, 3.1 and 3.2.3.mattblaze.org/papers/mk.pdf
- U.S. Patent US 12,473,748 B1, "Segmented Lock Pin," Jeffrey Scott Leaning, Nov. 18, 2025, background (FIG. 2, FIG. 3).image-ppubs.uspto.gov/dirsearch-public/print/downloadPdf/1247…
- BosnianBill's LockLab, "Anti-Picking Designs" (undated).locklab.com/locklab-university/anti-picking-design
- ALSOK, "Key stories vol. 3: Ancient Egyptian locks" and "vol. 9: Pin tumbler locks" (in Japanese, undated).alsok.co.jp/person/recommend/always/key/key03.html
- ALSOK, "Key stories vol. 3: Ancient Egyptian locks" and "vol. 9: Pin tumbler locks" (in Japanese, undated).alsok.co.jp/person/recommend/always/key/key09.html
- Lemelson-MIT, "Linus Yale" (undated).lemelson.mit.edu/resources/linus-yale
- ASME, "Linus Yale Jr.," July 13, 2012.asme.org/topics-resources/content/linus-yale-jr
- U.S. Patent 48,475, "Improvement in locks," Linus Yale Jr., June 27, 1865.patents.google.com/patent/US48475A/en
- Miwa Lock, cylinder types, company history, and discontinued cylinders (in Japanese, undated).miwa-lock.co.jp/tec/products/miwa_cylinder.html
- Miwa Lock, cylinder types, company history, and discontinued cylinders (in Japanese, undated).miwa-lock.co.jp/corp/history.html
- Miwa Lock, cylinder types, company history, and discontinued cylinders (in Japanese, undated).miwa-lock.co.jp/tec/support/abolition_cylinder.html
- Goal, "5 reasons to choose us" and company history (in Japanese, undated).goal-lock.com/5reasons/index.html
- Goal, "5 reasons to choose us" and company history (in Japanese, undated).goal-lock.com/company/history.html
- ABLOY, "Operating Principles" (undated).abloy.com/global/en-us/abloy-technology/operating…
- ASSA ABLOY, "Rotating disc cylinders," Apr. 20, 2026.assaabloy.com/it/en/stories/blog/disc-cylinders
- e-Gov Japan, Act on Prohibition of Possession of Special Lock-Opening Tools (Act No. 65 of 2003) (in Japanese).laws.e-gov.go.jp/law/415AC0000000065
- CP parts (Nov. 2002 council, tool-based testing): Tokyo Metropolitan Police Department, home crime prevention, updated June 6, 2022 (in Japanese).keishicho.metro.tokyo.lg.jp/kurashi/higai/akisu/akisu.html
- CP mark (May 2004), five minutes and 70%, not a guarantee: Osaka Prefectural Police, high-security building parts (in Japanese, undated).police.pref.osaka.lg.jp/seikatsu/bohan/2/1/6619.html
- Council membership: Miwa Lock glossary, "Crime-prevention building parts" (in Japanese).miwa-lock.co.jp/tec/support/glossary/words/2.html
- Miwa Lock glossary, "Picking" (in Japanese, undated).miwa-lock.co.jp/tec/support/glossary/crime/2.html
- EVVA, "MCS" (in German, undated).evva.com/at-de/produkte/mechanische-schliesssyst…
- Photo: "Door lock parts, wood - Museo Egizio, Turin" (Museo Egizio, CC0, Wikimedia Commons).commons.wikimedia.org/wiki/File:Door_lock_parts,_wood_-_Museo…
Voice, music, art
- Voices: Irodori-TTS (Japanese) / Kokoro (English)
- Music (OpenTracks): “なんでしょう?” by KK, “ちょっと楽しい” by 天野 七祈, “探偵推理中” by 田中芳典, “ensolarado” by Kyaai
- Music: “shuffle_shuffle” by KK, “昼下がり気分” by KK
- Fonts: Noto Sans JP, Inter, M PLUS Rounded 1c (SIL OFL 1.1)
