How It Ticks

Around the house · Exhibit 3

How does a lock work?

If your door key is a flat strip of brass with a jagged edge, it probably opens a pin tumbler lock, and the cuts in that edge do all the work. Inside the lock sit five or six pairs of tiny pins, and each cut lifts one pair to the right height. Get every pair right and the gaps between the pins line up exactly where the turning core meets the fixed body around it, a seam locksmiths call the shear line. Get one wrong and the lock stays shut. And the reason a lock can be picked at all is a flaw: no factory drills the pin holes perfectly in line.

Below is a lock cut in half and seen from the side. Drag the key in, press Turn, then try a wrong key or pick it with no key at all.

A pin tumbler lock cut along its length. The blue key pins ride on the key; the gray driver pins above them are pushed down by springs. In Pick it mode the plug gives a little when the first pin catches. Seen from the side, that turn points straight at you, so the toy shows it as a small step sideways, much bigger than in a real lock.

What is inside a lock?

Two pieces of metal. The housing is fixed in the door. The plug is a cylinder inside it with a slot for the key, the keyway, and when the plug turns, a cam on its back end pulls the bolt. The line where plug and housing meet is the shear line.

A row of holes runs through both. Each hole holds a stack: a key pin at the bottom, which touches the key, a driver pin on top of it, and a spring pressing everything down. Old patents call these stacks tumblers, which is where the name pin tumbler lock comes from. With no key in the lock, the springs push the driver pins partway into the plug. Each driver pin now sits across the shear line like a nail driven through two boards, and the plug cannot turn.

How does a key open a lock?

Key pins come in different lengths, and the cuts on the key come in different depths. A long pin sits in a deep cut, a short pin on a shallow one, so that the top of every key pin ends up exactly at the shear line. The gap between key pin and driver pin is then where the plug and the housing come apart, and the plug turns.

Linus Yale Jr. described it in his 1865 patent, in one long sentence that takes some decoding, and I like it more each time I do: the key is “a thin slip of steel properly shaped to bring the lines of division between the tumblers into the same line and flush with the periphery of the cylinder D”. D is the plug in his drawing, his tumblers are the pin stacks, his lines of division are the gaps, and the periphery of the cylinder is the shear line.

Why doesn’t a wrong key work?

A wrong key lifts some pins too high and some not high enough. Too high, and the key pin pokes up into the housing. Not high enough, and the driver pin still reaches down into the plug. Either way something crosses the shear line, and the toy paints exactly that piece red. One bad cut is enough: the toy’s wrong key misses on one or two cuts and gets the rest right. A lock forgives far less than a QR code, which carries spare data so that a phone can repair up to about 30% of it.

The cuts don’t have to be perfect, though. Parts that slide past each other need some room, what the MIT guide calls the sliding allowance, so a lock opens for a small range of cuts around the right one. I’d guess that’s also why a worn key keeps working for years, and why a copy cut slightly off often works too.

How many different keys does that leave? My toy’s locks have five pins and six depths, 7,776 ways to cut a key. Real keys can’t put a very deep cut right next to a very shallow one: the cutter comes in at an angle, and in Matt Blaze’s words, “the angle at which the bittings are cut reaches across to the next pin position.” Locksmiths call the limit the maximum adjacent cut specification. With my toy’s limit of three steps, 4,034 keys are left, and each opens only its own lock.

How does lock picking work?

Picking needs two tools. A tension wrench turns the plug lightly, the way the key would. A pick pushes the pins up one at a time.

If every hole were drilled perfectly in line, that slight turn would pinch every driver pin at once. You could still push one pin up to the shear line, but the others would keep holding the plug, so it wouldn’t give and nothing would stay put. Real rows are never perfect, and that’s my favorite part of the whole subject: turn the plug a little and one driver pin gets caught between plug and housing before the others. That one is the binding pin, and the lock gives in because of its own small flaw.

Push the binding pin up, and when its gap reaches the shear line, the plug gives a tiny bit more. The edge of the plug’s hole now sticks out under the driver pin like a little shelf, so the driver pin stays up there, resting on the plug, while its key pin drops back down. Then the pin is set, and the next one starts to bind. Set every pin and the plug turns.

In the toy’s Pick it mode, a free pin springs back as soon as you let go, while the binding pin moves stiffly and stays where you leave it, held by friction. Push it too far and you overset it. Its key pin jams in the housing instead, and the only cure is to ease off the wrench and start again. Try it in the toy: after the click, just keep pushing.

Which pin binds first isn’t random. In many locks the row of holes runs a hair off the plug’s axis, so when the plug turns, the hole at one end gets pinched first, and the pins tend to set from that end to the other, and the other way round if you turn the plug the other way. The toy picks a direction for each new lock and now and then swaps two neighbors, because real locks have other small faults too.

Two rules before you try this for real: only pick locks you own or have permission to pick, and practice on a spare lock, not the one on your front door, because a pin knocked out of place can leave you locked out. In some countries even carrying picks outside your home can be an offense, so check the law where you live.

What makes a lock harder to pick?

Better locks use security pins shaped like a spool or a mushroom, with a narrow waist. When the waist reaches the shear line, the edge of the plug drops into it, and the plug turns farther than it would for a real set. That’s a false set: it feels like progress, but the plug has only dropped into the waist, and the lock is no closer to opening.

The idea is at least as old as Yale’s 1865 patent, which already cuts notches across the pins; they serve, in his words, for “preventing to a certain extent picking of the lock.”

How do master keys work?

A master key system does the opposite of a security pin on purpose: it lets a second key open the same lock. A locksmith adds a thin extra pin, called a master pin or spacer, to some of the stacks, often just two or three, according to the MIT guide. Each of those stacks can now split in two places, so the tenant’s key opens the lock, the master key opens it, and so does a key that mixes cuts from the two. With a spacer in every stack, a six-pin lock made for one key opens for up to 64.

That convenience costs security. More places to split means more ways to pick, and in 2003 Matt Blaze showed how someone with one master-keyed lock, its own key and a few blanks can work out the master key for every lock on the same system.

Why won’t the key come out until you turn it back?

To slide out, the key has to push every key pin up the slopes between its cuts, so each pin needs room above it. That room exists only while the holes in the plug sit under the holes in the housing. Turn the plug and every key pin is trapped under solid metal. Try it in the toy: press Turn, then pull the key.

What’s the difference between a latch and a deadbolt?

The pins guard the plug the same way in both; the difference is in the bolt. The latch that clicks into the frame when you shut a door is a spring bolt. Its front is slanted, so the strike plate shoves it back as the door closes, and a spring pops it out again. A deadbolt has no spring and no slant: it moves only when you turn the key or the handle.

How old is the pin tumbler lock?

Pins that drop into a bolt and are lifted by a key are ancient. A wooden lock of that kind is reported to have turned up at Khorsabad, in northern Iraq, in the ruins of an Assyrian palace built about 2,700 years ago. Locks of this type still go by the name Egyptian lock. In those locks, though, lifting a pin too high did no harm. The split pin, which blocks whether it’s lifted too far or not far enough, is much younger: Abraham Stansbury patented a double-acting pin tumbler lock in 1805. Wikipedia credits Linus Yale Sr. with the modern pin tumbler lock in 1848 and his son with the flat key with serrated edges in 1861. The son’s patent of 1865, the one I quoted above, already has the cylinder, the pins and the flat key, and in 1868 he and Henry R. Towne founded the Yale Lock Manufacturing Company.

What this simplifies

In a real lock the plug is round, with the pins in a row along its top. The side view flattens that cylinder into a rectangle, and when the plug turns, the toy squashes everything inside it toward the middle, which is roughly how it looks from the side as the plug rolls away from you. I gave the toy five pins and six cut depths; real locks vary by maker. Picking by hand is also about feel: how hard you turn the wrench changes how stiff each pin is. I can’t give you that through a screen, so the toy draws two small marks next to the binding pin while you push it. Many modern locks add a second row of pins, side bars or magnets; this one has none of that, and no spool or mushroom pins either, so it is far easier to pick than most front-door locks. Combination locks and the flat wafers in car locks work differently and would need a toy of their own.

Sources