FacebookTwitter
Hatrack River Forum   
my profile login | search | faq | forum home

  next oldest topic   next newest topic
» Hatrack River Forum » Active Forums » Books, Films, Food and Culture » Math puzzle (probably impossible)

   
Author Topic: Math puzzle (probably impossible)
Lisa
Member
Member # 8384

 - posted      Profile for Lisa   Email Lisa         Edit/Delete Post 
I have a lovely puzzle at work, and I'm going to throw it out to you all before I even get started on it. On the chance that it's not impossible, and on the chance (better) that I fail to figure it out, maybe someone here will do better.

We have a list of ten PIN numbers (I know that's redundant, but it's common usage) we've created. And we have the database where the PINs are stored. But the application, which we don't have source code for (and are unlikely to be able to get) encrypts the PINs before storing them.

We're doing an app for a customer who uses this app, and they want us to use the native PINs. Which are encrypted. And we don't know how. You see the problem.

Personally, I think it's a waste of time to even try. The encryption I use personally for PINs when I'm coding stuff is one line of code, but it's still un-decryptable, for the simple reason that more than one input value can result in the same output value.

And even if it's possible, it may be that a sample of 10 PINs isn't enough. However, the co-worker with access to the app is gone for the weekend, so that's what I have.

code:
PIN     Encrypted PIN
7665 14178
6885 16377
9633 11160
0085 15571
4442 11945
6611 9137
2211 8733
5544 12066
8774 15269
9999 17520

Anyone want to take a poke at this? Or should I not even bother with it?

Btw, the encryption algorithm I use involves the ASCII value of the string representation of each number, as well as its location in the PIN. It's not complicated; but it works for me. It could be that this works along the same lines. That's one of the things I'm going to look for.

[ July 03, 2008, 06:42 PM: Message edited by: Lisa ]

Posts: 12266 | Registered: Jul 2005  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
Without some more knowledge about the algorithm, it won't be easy.

I'm surprised at the absence of standard hashing functions. These problems are well solved, and hand-crafted ones almost always have significant vulnerabilities.

Even without the source code, you could almost certainly decompile the binary and find the piece of code doing the hashing.

A few more examples would be good, but you might be able to get something out. If you suspect that sort of pattern, I'd just treat it as a set of data involving the digits and their positions as observations and do a principal components analysis. Any hash that's a linear combination of those should drop right out, and even if that isn't purely it, it should give you some hints.

And keep in mind that attackers don't need to decrypt it, they just need to find one PIN that hashes to the same thing and that will work with the application.

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Papa Janitor
Member
Member # 7795

 - posted      Profile for Papa Janitor           Edit/Delete Post 
Reorder the digits 4231, then add 7521.
Posts: 441 | Registered: Apr 2005  |  IP: Logged | Report this post to a Moderator
Lisa
Member
Member # 8384

 - posted      Profile for Lisa   Email Lisa         Edit/Delete Post 
I don't really know how to decompile code.

I tried summing the product of their ASCII codes and positions, and I got this:

code:
PIN     EncPIN  Result
2211 8733 17.71399594
6611 9137 18.09306931
9633 11160 21.37931034
4442 11945 23.33007813
5544 12066 23.0707457
7665 14178 26.40223464
8774 15269 28.3283859
0085 15571 29.71564885
6885 16377 29.99450549
9999 17520 30.73684211

I'm not concerned about the columns matching, obviously, since there could be a factor. I wanted to see if they'd fall into the same numerical order. And they almost do. So I think I'm on the right track. But I could play with this forever and never get anything.

How would you go about decompiling an executable? Or a DLL, which is possible. I haven't even looked at the installation yet.

Posts: 12266 | Registered: Jul 2005  |  IP: Logged | Report this post to a Moderator
Lisa
Member
Member # 8384

 - posted      Profile for Lisa   Email Lisa         Edit/Delete Post 
quote:
Originally posted by Papa Janitor:
Reorder the digits 4231, then add 7521.

Really?! Holy crow... that's amazing. How did you figure it out?

Boy, was I overthinking that one. That's brilliant. Papa, you are my hero.

Posts: 12266 | Registered: Jul 2005  |  IP: Logged | Report this post to a Moderator
Papa Moose
Member
Member # 1992

 - posted      Profile for Papa Moose   Email Papa Moose         Edit/Delete Post 
Well, I figured as long as it was only probably impossible, I might as well give it a shot.

First thing I noticed was the difference between the first two being 404, which made me figure it was just a reordering of the PIN plus some constant. I sorted the results, and could then see patterns in the PINs.

I like the idea of being brilliant, but I'm not sure this was it. *smile*

Posts: 6213 | Registered: May 2001  |  IP: Logged | Report this post to a Moderator
Papa Moose
Member
Member # 1992

 - posted      Profile for Papa Moose   Email Papa Moose         Edit/Delete Post 
Whoops -- It's 3241, not 4231. (I figured it out right, but didn't check when I wrote it down.) There goes the brilliant thing.
Posts: 6213 | Registered: May 2001  |  IP: Logged | Report this post to a Moderator
Lisa
Member
Member # 8384

 - posted      Profile for Lisa   Email Lisa         Edit/Delete Post 
No, it doesn't go. Why did 404 mean something to you? Normally, when I see a difference that's divisible by 9, I figure it's switched digits. But 404?
Posts: 12266 | Registered: Jul 2005  |  IP: Logged | Report this post to a Moderator
Papa Moose
Member
Member # 1992

 - posted      Profile for Papa Moose   Email Papa Moose         Edit/Delete Post 
404 caught my eye in conjunction with the 22 and 66 in the two codes. And I started with those two because they were the smallest resulting numbers.
Posts: 6213 | Registered: May 2001  |  IP: Logged | Report this post to a Moderator
Lisa
Member
Member # 8384

 - posted      Profile for Lisa   Email Lisa         Edit/Delete Post 
Huh. That's cool. And really helpful, too. Thanks so much!
Posts: 12266 | Registered: Jul 2005  |  IP: Logged | Report this post to a Moderator
scifibum
Member
Member # 7625

 - posted      Profile for scifibum   Email scifibum         Edit/Delete Post 
Yeah, actually...very smart. (I still don't get why 404, 22, and 66 got your attention. You're like Rain Man.)

And I must say that this is a terrible example of how to do encryption.

Posts: 4287 | Registered: Mar 2005  |  IP: Logged | Report this post to a Moderator
Mike
Member
Member # 55

 - posted      Profile for Mike   Email Mike         Edit/Delete Post 
Nice. Of course, if you know (or suspect) it's reorder-and-add-something, the 9999 is a dead giveaway.
Posts: 1810 | Registered: Jan 1999  |  IP: Logged | Report this post to a Moderator
Tante Shvester
Member
Member # 8202

 - posted      Profile for Tante Shvester   Email Tante Shvester         Edit/Delete Post 
quote:
Originally posted by scifibum:
You're like Rain Man.

Seriously.
Posts: 10397 | Registered: Jun 2005  |  IP: Logged | Report this post to a Moderator
Nighthawk
Member
Member # 4176

 - posted      Profile for Nighthawk   Email Nighthawk         Edit/Delete Post 
I gotta say, that's the dumbest form of "encryption" I've ever seen. Please tell me this isn't for a major financial institution or government agency...
Posts: 3486 | Registered: Sep 2002  |  IP: Logged | Report this post to a Moderator
Tante Shvester
Member
Member # 8202

 - posted      Profile for Tante Shvester   Email Tante Shvester         Edit/Delete Post 
Or at least tell him which one.
Posts: 10397 | Registered: Jun 2005  |  IP: Logged | Report this post to a Moderator
Sterling
Member
Member # 8096

 - posted      Profile for Sterling   Email Sterling         Edit/Delete Post 
So he can avoid it, or take advantage of it? [Wink]
Posts: 3826 | Registered: May 2005  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
Yeah, this is why strong hashes with a salt are very important.

And applications that need to authenticate against the same information should do so through the central app (though, like usual, this one probably wasn't made to make that possible).

Excellent deductive work, Papa Moose [Smile]

Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Lisa
Member
Member # 8384

 - posted      Profile for Lisa   Email Lisa         Edit/Delete Post 
quote:
Originally posted by Nighthawk:
I gotta say, that's the dumbest form of "encryption" I've ever seen. Please tell me this isn't for a major financial institution or government agency...

I can't tell you, but it's even odder than that. Still, the PIN is only used for ancillary stuff, so maybe they didn't think it mattered.

Still, I'm pretty amused.

Posts: 12266 | Registered: Jul 2005  |  IP: Logged | Report this post to a Moderator
Xann.
Member
Member # 11482

 - posted      Profile for Xann.   Email Xann.         Edit/Delete Post 
quote:
Originally posted by Nighthawk:
I gotta say, that's the dumbest form of "encryption" I've ever seen. Please tell me this isn't for a major financial institution or government agency...

Still, if he hadn't figured this out, no one was even on the right track.
Posts: 549 | Registered: Feb 2008  |  IP: Logged | Report this post to a Moderator
Shigosei
Member
Member # 3831

 - posted      Profile for Shigosei   Email Shigosei         Edit/Delete Post 
quote:
Yeah, this is why strong hashes with a salt are very important.
You're making me hungry.
Posts: 3546 | Registered: Jul 2002  |  IP: Logged | Report this post to a Moderator
   

   Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Hatrack River Home Page

Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2