Quidquid latine dictum sit, altum sonatur.
30 Aug
My landlord recently built storage lockers in our basement, and I dug through my junk drawer to find an old combination Master Lock to secure mine. I had forgotten the combination. Not to worry, as it’s not too hard to crack one if you have about 10 minutes to try up to 100 different combinations using this technique:
The first 60 seconds of this video demonstrates the technique to find the numbers:
This Python script makes it pretty quick to list the 100 possible combinations once you’ve isolated the last number using the above technique:
masterlock.py:
import sys
last = int(sys.argv[1])
remainder = last % 4
first = [remainder]
while first[-1] < 36:
first.append(first[-1] + 4)
if remainder == 0:
second = [2]
elif remainder == 1:
second = [3]
elif remainder == 2:
second = [0]
elif remainder == 3:
second = [1]
while second[-1] < 36:
second.append(second[-1] + 4)
for f in first:
for s in second:
print f, s, last
Just pass the script the last number in the combination, and it will spit out a list of all 100 possible combinations, like so:
python masterlock.py 7
Of course, this shows that combination Master Locks are really only secure if someone can’t spend 10 minutes messing around with your padlock without getting caught. And it means that if you have ten minutes, and something to write with and on, you can open someone else’s padlock. Don’t be a jerk.
I haven’t confirmed this, but I’ve heard that Master Lock redesigned their locks within the last couple years so that this trick doesn’t work anymore. My padlock was purchased before that.
I know that my padlock really isn’t protecting my stuff very well, but considering that the storage locker “walls” are made of chicken wire, the padlock isn’t the weak part of the system. The lock’s just there as a deterrent to keep my (hopefully) honest neighbors out of my stuff.
2 Responses for "How To Crack a Master Lock Using Python"
How very MacGuyver of you. Can you make a bomb out of a thong and fishing line as well?
No. I don’t have any fishing line.
Leave a reply