It’s Harry Houdini‘s birthday today. In his honour let’s talk about locks. As a famous escape artist, lock picking was his bread and butter.

First, let’s understand how a lock works. I’ll only be talking about the common pin-tumbler lock. (usually called a Yale lock, after its inventor in 1860) This is the sort you likely have on your front door, with a key having a series of mountains and valleys of different heights. While your key may slide into other locks, the height of those bumps determines whether or not it will turn.

Brass pins stop the lock cylinder from turning and un-latching the door. Each pin is in two parts, and it must be lined up precisely for the cut in the pin to align with the edge of the turning cylinder. If even one of those pins (most locks have five) is too high or too low the pin will bind and prevent turning.

The proper key corresponds to the cuts in the pins to set everything in alignment. If you’ve ever dealt with an old lock, or a poorly cut key, you may have had to jiggle the key to get the lock to work. That’s actually very similar to the process of picking a Yale lock.

Essentially, to pick a lock you randomly move the pins up and down until you get them to the right height. However, if they move freely up and down it seems unlikely that you’ll suddenly find them all aligned at once. Even if you did, you would never know if you didn’t turn the lock at that moment. So, step one of picking a lock is to apply some torque.

You turn the cylinder of the lock, twisting it with a small screwdriver, so that the pins are squeezed against the chamber walls. Now, with friction the pins will not slide freely up and down, but they can be moved by tapping gently with your lock pick. (a professional lock pick will have a small steel spring attached so you can “twang” it and create a subtle tapping motion) In a poorly made lock that has lots of give you may feel the moment when the first pin aligns. The torque should hold that in place as you move in to the second pin, and so on.

For any modern day Houdini a standard Yale lock is not too big a challenge, which is why many apartment buildings and offices employ more complex locks (such as Medeco brand). These require precise pin rotation in addition to height.