| « Crashing the Proxy | Announcing APDB: The World's Fastest Database » |
Nearly two years ago, I set out on the quest for a new house. Well, not new by any stretch of the word "new", but more foreclosed and dilapidated. It was 2008 and the market was flooded with homes, especially those of the not quite livable variety. As I explored house after house after house, I became intimately familiar with a device known as a key lock box. Generally used by realtors, key lock boxes are a convenient, low-tech way to provide combination code access to a lock that would otherwise require a physical key for access.
This was actually the first time I had ever seen a key lock box. Essentially, they're small steel boxes that contain a key and are often affixed near a keyhole (eg., the door handle). Some feature a set of dials that must be aligned with the right code, while others (such as the one pictured) use a pushbutton system to enter the combination.
Being that they're such low-tech contraptions, the pushbutton key lock boxes don't quite work like you might expect. For example, one popular brand will unlock if the four-digit code is entered in sequence, regardless of what or how many digits preceded it. That is, if the code is 2-3-4-5, pressing 1-2-3-4-5 will open the box. Taking it a step further, the sequence 4-8-2-9-5-1-4-5 would cover the codes 4-8-2-9 8-2-9-5 9-5-1-4 and 5-1-4-5.
Your exercise for the day: write a function that outputs a sequence numbers which cover all combinations within the sequence.
For bonus points, develop a variation wherein combination sequence doesn't matter; that is, pressing 1-2-3-4-5 not only covers 1-2-3-4 and 2-3-4-5, but also covers 1-2-4-3, 1-4-3-2, 1-4-2-3, and so on (but does not cover 1-2-3-5 and variants).
Thanks to Daniel Lundgren for suggesting this challenge.
|
Quite honestly, this is a ethically questionable code challenge.
You're not only revealing how these lock boxes work (Which, yes, would be commonly available information), but you're announcing "to the world" that they're simple to break into, with a solution to how to do it. Why do I have issue with this? People selling their house have a realtor, who will use lockboxes. For the seller, there's no guarantee that others will use spin-wheel, combination, or push-button lockboxes, and the seller has no say on what will be employed. You're now telling people how to get a key for doors to houses for people who are selling for one reason or another. Most will not use this information in a negative manner, however, some douche out there will take this information (which might not have been apparent) as an invitation to start ripping people off. Think about it - you're selling your house. You're not home most of the time (Work), and neighbours are used to seeing people coming and going into your home. And then you find a website which is announcing a contest, for fun, on how to get a key for your house. Strike anyone else as questionable / bad idea? Tinfoil hat wearer I'm not, I just have issues with other people's ethics (Such as the dick who did this to a friend some months ago) |
Re: The Key Lock Box
2010-03-31 09:52
•
by
db48x
(unregistered)
|
|
It's not ethically questionable at all. It's far better to encourage people to think critically about the security measures that they employ than it is to try to hide this kind of information. Hiding information never works, those people who would abuse it already have it, while the rest of us need to be sure we understand how the technology around us works.
Of course, the sad fact is that all locks are much easier to get past than the manufacturers claim. I'm sure there's an easier way to attack a lock like this than brute-forcing the combination, but it's an interesting programming problem nevertheless. There's a known algorithm for finding the shortest sequence when the attempts can overlap like this, but I can't quite think of the name… |
| « Crashing the Proxy | Announcing APDB: The World's Fastest Database » |