Where I work we have push button locks on our doors similar to this one. The way they are set up is there are five buttons but the code for each door is 4 non-repeating numbers. So, for instance, the code 1234 would be acceptable but 1123 would not since the number one is repeated in the sequence.
Since I work in a large building and each door has a lock with (presumably) a different code, I was trying to figure out how many combinations this set-up could accommodate. I was thinking that with only 5 buttons, the maximum number of combinations would be 5e5 or 3125 assuming a five digit code and allowing repeats. Since we use only 4 numbers in our codes the max number would be 625 or 5e4 combinations assuming the use of repeated numbers.
Now, since the codes do not allow repeated numbers I think the max number of codes would be 5x4x3x2=120 possible combinations. If this is the case then a lot of the locks around here have the exact same code. That’s probably not a problem since nobody would know which doors are the same. The main problem I see, if my math is correct, is that it would only take a maximum of 120 tries to access any door in the building. That doesn’t seem very secure.
So, I’m wondering if my math above is correct or am I missing something.
FYI that kind of lock also allows for combinations with two or more buttons pressed simultaneously, e.g. 1 and 2 together, then 3, then 4. There are 1081 total possible combinations.
The answer is 1. They are all set to the default 1 & 5, 3 and are never changed. I think it’s the only combination that works. The other buttons are for show.
What do you mean by non-repeating? 120 is correct if you may not reuse a number anywhere in the combination. For example, 1231 would not be allowed. If the restriction is that you cannot repeat a number twice in succession, as in your example of 1123, then the number is 5x4x4x4=320. Still not a huge number, though.
We have a similar pushbutton lock. It allows simultaneous button presses, which increases the number of combinations a bit. This page claims the total number of possible combinations is 540. It’s not a wide open door, but it’s not exactly a bank vault.
The former; those locks are mechanical. Once you press a button, it is “set” and cannot be pressed again unless the whole thing is reset, by turning the handle.
Not directly related to this particular problem, but I noticed back when I was in high school (when dinosaurs still roamed the earth) we used Master Comibination Locks on our lockers. They had a 3 digit combination, and 30 or so digits around the edge. That’d lead, you’d think, to 30 X 30 X 30 = 27000 possibilities.
But I noticed that all the combinations I was aware of (my own changing locks, and those of trusted friends) fit into a pattern – the second digit differed from the first by 4n, and the third differed from the first by 4m + 2. Digits never repeated. There were a lot fewer combinations that were actually used than you’d naively expect.
Yeah…the locks over here are similar to the one linked but not exact. It may very well allow for combinations that include two buttons pushed simultaneously but none of the ones I know the codes for include this feature. Granted I only know about 10 or 12 different codes.
Those master combination locks aren’t exact though. If you’re off on any of them by 3 or less the combination will still work. So it’s more like 10x10x10 or 1000. I never noticed the pattern you found, but that might have something to do with it.
The slotted discs inside those locks are less precise than the markings suggest. (The numbers, or course, are just painted on and not connected to the mechanism.) The +/-2 reflects that.
As stated upthread, multi-number presses are allowed for those locks, but 1081 combinations still isn’t very large. We had those sorts of locks all around campus when I was in college, and I could brute force them in just a few minutes typically but guaranteed under twenty minutes to get through every possibility.
If you limit yourself to combinations which have exactly 5 digits, then yes there are 5x4x3x2x1=120 combinations. If you also include 4-digit combinations, you get another 5x4x3x2=120 combinations, total of 240 so far. If you include 3-digit combinations (which are by far the most common), you get 5x4x3=60 more. Now we’re up to 300. And there are 5x4=20 2-digit combinations and 5 1-digit combinations, so that’s 325.
The lock also allows simultaneous button pushing. For example, the default combination is [24] 3 which means you press 2 and 4 simultaneously followed by 3. This is not the same as pressing 2 - 4 - 3 or 4 - 2 - 3.
If you allow combinations as short as 1 digit, and as long as 5 digits, and everything in between, and you also allow pairs of buttons pressed simultaneously, and also triples of buttons, and also quadruples, and also quintuples, and you also allow more than one pair, or a pair plus a triple, basically all the craziest combinations you can possibly think of, everything from the incredibly stupid “push the 3 button and that’s it; you’re done” up to the insanely difficult “press the 2 and 5 buttons simultaneously then press the 1, 3, and 4 buttons simultaneously”… then you have 1,081 combinations.
But there’s one more trick up our sleeve. Your last button push, whether it’s a single button or a group pressed simultaneously, can be pushed halfway and the lock can tell the difference. 1 - 3 - 5 is different from 1 - 3 - 5(halfway). So by either using this halfway button push or not using it, you can effectively double the number of combinations to 2,162. But in real life I’ve never seen anybody do it.
Speaking as a Certified Master Locksmith, this is a low security lock. There are limited numbers of combinations and there’s nothing to stop someone from just standing there guessing over and over until they happen to get it right. This is much less secure than a standard pin tumbler lock with a key. Do NOT use this lock on the front door of your house.
I encounter a lot of these locks at work. Set to a wide variety of codes, code lengths, and patterns of single- and two-simultaneous button pushes.
I’d noticed the feel of a two-step button on the last push, but had assumed it was the extra effort of moving the lock engage/disengage tab into the final position after the first half-push satisfied the combo.
Interesting to know there’s more to it. And no, I’ve never encountered one programmed for the half-push mode either.
Because the last button in a 5-digit code is completely determined by the first 4 digits–there’s no choice in which button you push (only whether you push it or not).
When you find one of these locks on a stock room door in a retail store it is real easy to figure the lock. Look at the door frame. Someone will have written down the combination in faint pencil.