loading

Make a working key from scrap metal by reverse engineering a lock

Featured
Picture of Make a working key from scrap metal by reverse engineering a lock
Have you lost all of the keys for your lock and need to make a new key from scratch?  Does the locksmith lack a key blank that will fit your lock's keyway? Grab a metal file, some scrap sheet metal, and read on for a rough & tumble do-it-yourself key making guide!
I made mine at http://techshop.ws

Reverse engineering a key from a lock is not that difficult, providing the lock can be disassembled. In order to follow this instructable you will have to have access to the lock itself, which usually means the lock is not locked to begin with. If you're hoping to make a key for a container that is currently locked, you'll have to pick it open first, or research the key making method known as 'key impressioning'.
 
Remove these adsRemove these ads by Signing Up

Step 1: Disassemble the lock

Picture of Disassemble the lock
The filing cabinet lock I was working on had an external housing that needed to be opened before the lock itself could be accessed. It had a set-pin that needed to be drilled out. Drilling the pin slightly off-center with a bit smaller than the pin was enough to prevent it from spinning in place, but disintegrated the pin sufficiently that the housing could be opened without causing undue damage to the rest of the lock. This is not usually a necessary step for standard door locks.

Once the lock has been removed from its housing (door handle, drawer, whatever), there is usually a cover on the top of the lock that holds the pins and springs in place. This cover is often clipped in place and can be removed without damaging anything. In my case, the edges of the pin holes were uncovered, but crimped half-shut and needed to be widened with a drill in order to extract the pins. As you remove the pins, keep them in order front-to-back and keep track of the 'top' and 'bottom' pins. Each pin has a specific shape that allows it to interact with the spring, with the pin above/below it, and/or the key itself, depending on where it is sits in the pin-stack. A helpful tool for keeping things straight is a small piece of paper like a post-it note folded into an accordion shape so that each pin-stack can be laid in its own trough.

Removing the lock core from the sheath is usually a helpful step even if it isn't absolutely necessary. I recommend  removal if at all possible (but don't pull it out until you've removed the pins, or they'll shoot everywhere!) Sometimes the pins cannot be removed except by pulling the core. If this is the case, be careful to expose only one stack of pins at a time, or you'll have some sorting to do when all the pins cascade out of the lock.

Step 2: Take keyway measurements

The first step in actually fabricating the key is to make something that will properly fit into the keyway itself, effectively making a keyblank like you would normally be able to purchase from a locksmith. The important measurements involved are:

1. The width of the keyway - the key shouldn't wiggle left and right very much, though a little play is OK.
2. The height of the keyway - the keyblank should push the pins all the way to the roof of the keyway without much play at all.
3. The length of the keyway - the key needs to extend past the deepest pin plus a little extra. Making the keyblank so it extends all the way to the end of the keyway is a safe bet.
4. The location of the keyway wards - little triangles or rectangles chunks that stick out from the left and/or right side of the keyway will require that grooves to be cut along the side of the keyblank in order for it to fit into the keyway.
4. The distance of each pin hole from the front of the lock - this will determine where on the key the cuts for each pin need to be made

Step 3: File a key blank to the proper dimensions

Picture of File a key blank to the proper dimensions
DSC_0944.JPG
Select a piece of sheet metal that is as thick as possible without being thicker than the width of the keyway. I used some cheap steel from the innards of a old broken laser printer. Computer towers are probably another likely source for raw material. If you're really in a pinch, you could even make a temporary key out of plastic if you really had to.

The part of the key that should be flush with the front of the lock is referred to as the 'shoulder' of the key, and causes the key to stop at the appropriate depth each time it is inserted into the lock. Using my keychain as a reference, most keys have a shoulder at both the top and bottom of the blade, but if you're making your key by hand you might want to consider passing on the bottom shoulder. I'll discuss that in just a moment.

The bottom of the blade of the key should be perfectly straight. This can be difficult to achieve with hand-filing, I was fortunate enough to have access to a mill, and used that to get a straight line and to ensure that the top and bottom of the blade of my key were parallel to eachother and that the top and bottom shoulders described a line perpendicular to the blade.

If you're in a more dire situation and are filing everything by hand, it would probably be OK to just have one shoulder at the top, allowing you to leave the bottom of the key flat and saving yourself a lot of filing. The advantage of omitting the bottom shoulder is that if the scrap metal you are working with already has a factory-straight edge, you can use that edge as a known flat surface to use as the bottom of your key without having to use a square to check the quality of your filing. This will save you time, and save your filing endurance for the remaining tasks. The drawback would be that the blade of your key will tend to lift slightly when inserted fully into the lock, the top shoulder becoming a pivot point for the forward pressure on the key, and can cause the lock to bind as you turn the key. If you're in a rush to get a key made, that may matter very little, but if you want to make a key that will be in use for years, taking the time to file down the bottom edge of the blade to create a bottom shoulder is probably worth the time and cramped fingers.

Once you have a flat bottom (shoulder or no), scribe a parallel line matching the height of the keyway to indicate how tall the key blade should be. File away all material above that line. If you have metal snips, use them to rough out the dimensions then file down the last little bit. The top shoulder is an absolute must, and should be exactly above the bottom shoulder if you opted to make one. The key blade does need to be slightly smaller than the keyway or it won't fit inside, but it shouldn't be loose enough to rattle around. Of course, you won't be able to tell how well the height of your key blade matches the keyway until you cut grooves to match the lock's wards.

Step 4: Cut grooves for the wards into the key blank

Picture of Cut grooves for the wards into the key blank
Key-blank making factories have special metal-cutting blades to cut these grooves consistently. Unless you have one of these tools, however, things get more complicated. Even though I had access to a milling machine, I didn't have an end mill small enough to cut such small grooves. Instead I used a drill with an abrasive cut-off wheel to grind troughs into the side of the key. The work was pretty coarse, but the quality of the lines isn't very important here. As long as you grind away enough material so the key isn't hindered by the wards of the lock, and you leave enough material on the key so it won't snap, that's good enough. It can get tricky when there are wards on both sides of the keyway, and care needs to be taken to not grind straight through the middle of your key. Fortunately, the blade of the key has more to do with properly lifting the pins than it does turning the lock, so you should be okay. Just do your best.

Towards the end of this process I would grind away a little material, test fit the key in the keyway, and see where there was friction. If the key didn't go all the way into the keyway often there was a small mark on the key where it had gotten stuck and rubbed against the side or top of the lock, indicating where there was a 'high' spot that needed to be filed or ground down a little more. You can be fairly aggressive when filing on the top edge of the blade since most of that will get filed down to the proper height for the pins. It is possible to go too far, but unless you're using a bench grinder, it's unlikely you'll cross that line while trying to get the key blank into the keyway.

Step 5: Mark the location of each pin's hole on the key blank

Picture of Mark the location of each pin's hole on the key blank
At this point you should have a key blank that goes smoothly into the keyway and whose insertion is stopped by the shoulder(s) of the key.

The next step is to determine where each of the cuts will be made along the length of the key. Not the depths of the cuts yet, just spacing from from the shoulder(s) towards the tip of the key.

Remove the key blank and using the measurements you took earlier of the pin hole spacing, mark along the blade where each hole will fall along the blade of the key. Alternately you can leave the key in the lock and try to mark the top of the key using a pencil lead or a pin, or something. Maybe you could even sprinkle a dusting of graphite powder into the holes and then pull the key out to see exactly where those holes line up. However you do it, double check your work by sticking the key back into the lock and looking down the pin holes to verify that everything lines up before you start filing.

Step 6: (option 1) Cut the key to the appropriate pin heights using pin measurements

Picture of (option 1) Cut the key to the appropriate pin heights using pin measurements
If you've got access to precision equipment, and have complete trust your ability to 'measure twice, cut once', you can cut the proper pin heights into your key without looking at the lock again. If you don't trust yourself, or don't have access to digital calipers, head to the next step, which will accomplish the same task using low-tech methods.

Even if you do have digital calipers, I suggest using the methods in the next step.


OK, so you've got your digital calipers, a paper to do calculations on, and a steady resolve. Let's do this thing, one pin at a time.

You first need to determine the depth of each cut, or rather, the height of the material that should remain on the key blade at that point. That height will need to be calculated based on the height of the bottom pin that will be placed in the associated pin hole. The height of the cut key at each hole plus the height of the bottom pin needs to equal the distance from the bottom of the keyway to the top of the lock's core.

(bottom of keyway to top of core) - bottom pin's height = height of key at that position

If you have not pulled the core out of its sheath this can still be calculated. In theory you could use a depth gauge (or paperclip) to measure the distance through one of the pin holes from the top of the sheath to the bottom of the keyway, then measure the distance from the top of the sheath to the top of the core by turning the core so it's pin holes no longer line up with the holes in the sheath.

((top of sheath to bottom of keyway) - (top of sheath to top of core)) - bottom pin's height = height of key at that position


Using a micrometer or digital calipers to get these numbers would let you determine exactly where each cut in the key's blade should end. If you have an endmill the same diameter or smaller than the pins (they're pretty small!) you can quickly mill each slot, otherwise you're stuck using a file. I recommend scribing the proper cut depth on the side of the key blade (measure from the bottom of the key!) and then filing (or milling) to just above that line, then slowly fine-tune the depth with a file using the lock and the associated bottom pin to verify the proper depth of the cut. Its probably possible to mill a key precisely enough for the key to work the first time, but I doubt you'd get it right without a fair amount of practice.

Yes, I'm still pushing for you to use the no-measuring method, which works great for a one-time job.

Step 7: (option 2) File the key to the appropriate pin heights without using pin measurements

Picture of (option 2) File the key to the appropriate pin heights without using pin measurements
DSC_0959.JPG
Insert your keyblank into the keyway and put any one of the bottom pins* into its corresponding pin hole. You'll notice that the pin sits taller than the top of the core of the lock. This is easier to see if you've pulled the core out of the lock ... but this isn't strictly necessary. Our goal will be to file away the top of the key just beneath that pin until the top of the pin is exactly flush with the top of the core of the lock. No taller, no shorter. No pressure, but if you mess this up you'll have to start from scratch.

Now, ever so carefully, file a groove in the top of the key for that first pin. The amount of material you will be filing away will be equal to the distance that the pin is sticking up from the top of the lock's core (not the whole height of the pin, not the height of the pin from the top of the lock sheath). Again, this is easier to see when the core has been removed from the sheath. As you file, frequently check the depth of your groove by inserting the key into the lock and checking that the bottom pin you're working with sits closer to the shear line. Be sure the groove you are filing is at least as wide as the pin. If the groove is too narrow, the pin will get caught on the sides of the groove, and if it isn't touching the bottom of the groove you may actually be filing deeper than you should be without seeing the appropriate change how the pin settles into the cut. Also, be careful that you do not file your groove too wide, since this will affect the sloping transitions from one pin height to another that are required for keys to slide smoothly in and out of a lock. We'll talk about those in a moment. Finding a file narrow enough to file these grooves may be tricky. I use the edge of a rectangular jeweler's file, but in a pinch the corner of a larger file can be used, its easier to keep the bottom of your groove parallel to the bottom of the blade if you use a flat file. It is possible to use a larger file tilted at a 45 degree angle, you just have to work more carefully to get a flat bottomed cutout.

As you approach the proper depth, you will find that you can begin to turn the core of the lock within its sheath, but the lock will bind without being able to make a full rotation. This means you are very, very close to the proper height. Continue filing off very small amounts until the key turns smoothly. Taking off a little too much at this point is easy to do, and that will leave you with a key that you have to rattle around in order for it to turn, if it works at all. Be careful! As a check to see if the groove is too deep, put the top pin into the pin hole on top of the bottom pin and see if the key still works. If it doesn't turn when the top pin is inserted, you've gone too far. You may as well start over now on a new key without wasting time filing out the grooves you haven't started yet.

Once you've got one pin working smoothly, repeat this process for the remaining pins. Watch a movie or something, this can take a while depending on the quality of your file.

*I recommend starting this process with your shallowest cut first, that way if you DO end up going too deep on one of your grooves, you can actually swap that bottom pin with a taller pin (whose position on the key has not yet been cut) and continue filing down the groove you're currently working on until you reach the proper depth for the new pin you just swapped in to that position. If you keep working from shallowest cut to deepest cut, you can mess up a couple of times and still end up with a working solution. Do note that no existing keys for the lock will work one you start swapping the bottom pins around (but the whole reason you're doing this is because you don't have any keys, right?)

If there is a disaster of some sort and one of the depths of your keys is definitely too deep, there is one last resort: remove that stack of pins completely: bottom pin, top pin, spring, everything. That significantly reduces the security of the lock, making it easier to pick, and increasing the number of other existing keys that will open your lock just by random chance. You could even remove all of the pins except one, and the lock will still technically work. You'd just better hope nobody ever casually or accidentally tried to 'break in'.

Step 8: File smooth transitions between each of the cut depths

Picture of file smooth transitions between each of the cut depths
If you look at your keychain, you'll see that each key has nice 45 degree angles between the flat sections that determine the pin depths. These 45 degree angles are to help the key push past the pins until it is fully seated in the lock. If the transitions between pin heights are at too steep an angle, the key will bind as it is inserted into the lock. File down the vertical walls of each groove you've cut so that they have a nice slope to them and won't snag the pins. Missing even one of these can make for a key that either won't go into its lock, or won't come back out once it has been inserted. Be careful not to accidentally file away any of your perfect pin surfaces now that you've gotten this far. Be sure to file an angle on the tip of your key as well. The angle at the tip usually starts just below the highest ward, which pulls double-duty both as a ward and as a way to keep the pins from falling to the bottom of the keyway.

Step 9: Reassemble and make final adjustments

Picture of Reassemble and make final adjustments
At this point you should have a key with cuts at the proper distances and depths to open your lock. You'll only know if it really works once the lock has been fully reassembled. Go ahead and put all the bottom and top pins back in their respective holes and replace the cover over the pins or re-crimp the holes. If you've taken care to get everything right, your key should work smoothly in the lock.

If it is hard to push the key in or out of the lock, take another look at the angles of the transitions between each pin depth. If any are steeper than 45 degrees, try to smooth them out if possible. Just be sure you don't file away the bed where a pin needs to rest.

If the key does not turn smoothly in the lock, either one of the cuts is not wide enough (the pin may be resting part way up the side of a trough) or there is a problem with the the depth of one of the cuts. You can sometimes tell if a cut is off-center or not quite deep enough because the pin will leave a small indentation on the key. Look for a shiny dot in the marks left by your file. If there is one, try very lightly filing down that one spot. If there are no indentations or markings from the pins, you may have a spot that is too low. There's not much you can do about that other than live with a lock that sticks slightly or try making another key. If the key doesn't turn at all, something is really wrong. Disassemble the lock again and double-check your work from step 7.
_soapy_11 months ago
Nice job. Buff it on a wheel or use light sanding to smooth it out a bit, & wear should be low enough it'll be fine for years.

I'd also recommend you always change the pins around when doing this, because that way you have revoked the old keys, which could be anywhere (stolen! )

I'm a pro, but I've done this on non-fitting-but-quite-close blanks so that I have the right blank for a job, on occasion. Sometimes even a locksmith can't get the right blank! I've yet to have to make a cylinder key from scratch though. Lever locks, on the other hand...

One other tip: you can file down the pins rather than the blank. It's a bad idea as a locksmith, but for a one-off gig like this, you can get the key quite close then file the tops of the pins that are sticking up a little. Just make sure they are all either right or too long. You can't file them longer!

Finally, if you want to improve the security of the lock against picking, you can file the longest pin around the middle, into an I (capital i) bobbin or spool shape. This makes picking harder. Do a top & bottom pin pair, which will annoy anyone trying to bump it too.

Great !

jaxboy1 year ago

I am so glad you did this 'ible! I have an old lockbox to which I just lost the last key, and it is used to secure my class III medicine. More than once, I have found medicine missing, so this is a God-send! Right now, I'm having to pick the lock each time to open AND close it, so this will be so much easier. Your 'ible is very clear, so I feel confident I will be able to make a key now. Thanks again.

golond (author)  jaxboy1 year ago

I'm glad this will see some actual use! Picking the lock twice every time you need to get into the box sounds like it would be a real hassle, but you're probably getting pretty good at it, eh? Feel free to message me if you run into anything unexpected. Good luck!

pvizgaudis1 year ago
Love the writeup. but if you wanted to really make it easy, you can do just a couple of the pins only. That would really save effort and time. Again I Love the writeup on this.

This recommendation is very good, and I would add, just use one pin in the reassembly, then you don't even need to fit a key. The lock will push in and lock, appear secure, and can easily be picked with a bobby pin, and yet if you stick a key in the lock, might push the pin past the shear line, and keep it from unlocking.

Sounds like good information.
skylane1 year ago

Burglars...PAY ATTENTION!!

if they have enough time to carve a new key from scratch, then they deserve to steal your stuff. asside from the fact that if they can dissasemble the lock in the first place to make a key, they're already inside.

TinkernTom1 year ago

As a professional locksmith, I have a few pointers.

Where are the Pin Springs in your pictures, and reassembly instructions. The springs are used to push the pin stack down onto the key, and they make reassembly much more difficult.

Use brass stock, instead of steel so that your new key does not act like a saw cutting into the pins and lock body which are made of brass and white pot metal respectively. Besides being easier to work and impression. You can usually go to a local lockshop and buy the proper keyblank for your particular lock.

You can use this technique for fitting a key because the tolerances in this type of lock are very loose.

Assuming that security is not your main consideration with this file cab, just reassemble without the pins and springs, the lock can be locked by pushing in, and opened with a nail file or what ever, and yet it will appear secure. Security is usually a matter of appearances!

Otherwise a fun exercise I am sure for a few curious, and hopefully they end up appreciating the work that some of us do daily!

golond (author)  TinkernTom1 year ago

All great points. Thanks for sharing your experience!

I'll try to take some additional pictures and modify the instructions to more specifically include the springs. They're definitely pesky little things to get back in.

I hadn't considered the wearing effect that a harder metal would have on the pins. Definitely something to take into account if making a key that will get regular use.

raevans551 year ago

I can well understand the feeling of achievement in creating the key. But in my view, the amount of work involved isn't really justified, as it would make a lot more sense to just go out and buy a new lock, which'll obviously come with a set of keys.

golond (author)  raevans551 year ago

Necessity is the mother of invention. In this case, I needed to lock a filing cabinet containing sensitive information before turning over a property to house-sitters. I only had a few hours notice that I was leaving town. The local locksmiths were all closed for the day, the office supply stores did not sell replacement lock/key sets, and hardware stores did not have key blanks for the keyway. Making a key was my absolute last resort!

That wasn't clear in the article. So in that case, VERY WELL DONE!!!!
SRQ Sid1 year ago

Great write-up and explanation of lock term and functions. I hope I never have to do this but its nice to know it can be done with hand tools. Thanks.

togaclad1 year ago

Great write up!

I've done this exact thing. I used a dremel to do the coarse cuts. Also I found the local hardware store would sell or even give me blanks as a starting point. On the other hand if you want a cool looking custom job, this is the way to go.

I like the look of that key. Maybe a bit too pointy for going in my pockets though. Makes me want to make my own key grinder.

golond (author)  shizumadrive1 year ago

Yeah, I leave this particular key in the lock all the time, so sharp and pointy was okay! I just replaced a noisy AC motor in my furnace, so maybe I'll use that to make a 'key cutter from scratch' instructable. ;)

That would work.

Cool make the key cutter project. That would make a good grinder.
jexter1 year ago

Very nice tutorial, thanks for posting this!

I don't know much about how locks work, but if the original key is lost and can't be replaced, can you put the pins in different positions than they were originally? The reason I ask is that if you could start with the shortest pin in the first position, and you ended up filing to much off of your key blank on your first try, you could switch to the next longest pin and still use the blank instead of having to start over. Do the same with the next position, until you get the hang of filing *carefully* ;-) Would that work?

golond (author)  jexter1 year ago

Hi Jexter,

I think your question is closely related to my footnote on step 7. As long as you don't need any existing keys to work after you finish making your new key, you can rearrange the pins of the lock however you like.

If you do move pins around, be sure to keep top and bottom pin pairs together. Sometimes the top pins have different heights so they inversely match the variation of heights of the corresponding pins, sometimes they don't. If you end up putting a tall top pin on top of a tall bottom pin the resulting pin stack might be too tall for the lock, and the key will jam when you try to put it in the reassembled lock. Similarly a short top pin paired with a short bottom pin won't properly interact with the spring on top of the pin stack, and the pins can get stuck up in the lock preventing it from opening even when the proper key is inserted.

I think you already understand what I'm going to say next, but I'll say it anyway just in case. ;) I didn't mean to start with small pins at the front of the lock and work your way to the back of the lock incrementally increasing the pin size, like a ramp or a hill. Part of the security of a lock comes from alternating tall and short bottom pins in order to make it more difficult to pick open. Reordering pins is ok, but keeping things looking 'random' is a good thing.

If you really mess up the cut for a pin and don't want to start over, you can just leave out that stack of pins, but sacrifice some of the security of the lock to do so.

Let me know how it goes!

Interesting. I've never been able to salvage a lock after I took it apart though.

PowerBot1 year ago

Nice work, I`m gonna try that !!!

That is insane! Bravo :D

Great instructable!