← All experiments

Experiment

Build a lock a stick can't open

Five little pins, and only the right key lines them up. Build it wrong first: one pin that any stick can lift clear.

From the Short "Why Only YOUR Key Opens the Lock". ▶ Watch the Short

A pin lock cut away and seen from the side: a grey body with pin chambers, springs pushing pins down into a lighter turning plug, a key slot along the plug, and a small end view of the plug in the corner. cut-away, simplified body plug shear line driver pin key pin spring end view

Build a lock: one pin

A cylinder, the plug, turns inside a fixed body. A spring pushes a pin down through both, and it's jammed. A key lifts the pin clear, and the plug turns.

Open it with the key. Then try a flat stick. Then add more pins and try the stick again.

In the lock

PlugLocked
Pins clear of the plug0 of 1
What opens itAny stick

What's going on

This is the pin tumbler lock, the most common kind of key cylinder on house doors and padlocks. The key turns a cylinder, the plug, inside a fixed body. A row of holes, the pin chambers, is drilled through both. At the back, a cam or tailpiece on the plug works the bolt.

The one-pin lock in step 1 is made up, not a real design. With one solid pin, any lift that clears the plug opens it, however it's done. That's why real locks split each pin in two: a key pin at the bottom, which touches the key, and a driver pin above it, under a spring.

The shear line is where the plug's outer surface meets the body's inner surface. With no key in, the springs push the driver pins down across it, and anything crossing it stops the plug turning. The right key lifts each key pin so that the split sits exactly on the line: every driver pin wholly in the body, every key pin wholly in the plug. Lift one too little and its driver pin still crosses the line; too far and its key pin does.

Key pins come in a set of lengths matched to the depths of the key's cuts. House locks usually have five or six pin stacks; some have four or seven. With five stacks and five to ten possible lengths each, that's about three thousand to a hundred thousand different keys in theory. Makers rule some out, but it's still thousands or more. It also means a key isn't unique: any key cut to the same pattern works.

Once the plug has turned, the key pins are pressed down by the body's inner wall, so they can't rise up the slopes of the key's cuts: the key can't come out until you turn it back. Pull it out, and the springs push the driver pins back across the line. Locked again.

Simplified: the lock is drawn many times larger, cut away and seen from the side, with pin ends drawn flat (real ones are often rounded or pointed) and the gaps exaggerated. The turn is shown in the end view, while the parts inside the plug fold away as they would seen from the side. In step 1 the made-up key and stick reach right up to the shear line, and in step 2 the lift is set by trying flat keys of different heights. The number of keys counts every pattern, before makers rule any out. In step 3 you can match the cuts to the pins only because the lock is drawn cut open.