aspose file tools*
The moose likes Programming Diversions and the fly likes What is this riddle? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "What is this riddle?" Watch "What is this riddle?" New topic
Author

What is this riddle?

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Hi,
On one of job boards, the employer posted this riddle for extra points:

NTc6Njg6NjU6NmU6MjA6Nzk6NmY6NzU6MjA6NjU6NmQ6NjE6Njk6NmM6MjA6NzU6NzM6MmM6MjA6NjM6Njg6NjE6NmU6Njc6NjU6MjA6NzQ6Njg6NjU6MjA6NzM6NzU6NjI6NmE6NjU6NjM6NzQ6MjA6NzQ6NmY6MjA6MjI6NTQ6Njg6NjE6NzQ6Mjc6NzM6MjA6NjE6NmM6NmM6MjA6Nzk6NmY6NzU6MjA6Njc6NmY6NzQ6M2Y6MjI6MjA6NjE6NmU6NjQ6MjA6Nzk6NmY6NzU6NzI6MjA6NzI6NjU6NzM6NzU6NmQ6NjU6MjA6Nzc6Njk6NmM6NmM6MjA6NmQ6NjE6NmI6NjU6MjA6Njk6NzQ6MjA6NzQ6NmY6MjA6NzQ6Njg6NjU6MjA6NzQ6NmY6NzA6MjA6NmY6NjY6MjA6NzQ6Njg6NjU6MjA6NzI6NjU6NzY6Njk6NjU6Nzc6MjA6NzM6NzQ6NjE6NjM6NmI=

Seriously, what is this?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Looks like something that was encoded with base-64.
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

How did you figure it out that it is encoded with base-64?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Experience If you'd seen multiple base-64 encoded strings you'd have noticed as well.
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3479

Any pattern to recognize base-64 encoded strings?
The first time I saw it, I felt it is about hashing or encoding but not really as accurate as your answer
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
The trailing equals sign is a give-away. And, of course, the limited range of characters (just letters and digits, for the most part).
Dave Trower
Ranch Hand

Joined: Feb 12, 2003
Posts: 86
Here are the steps to decode:
1) Go to a base 64 base decode website. There are several, but I went to http://www.opinionatedgeek.com/dotnet/tools/base64decode/
I copied what you put in this post and it decoded to this:
57:68:65:6e:20:79:6f:75:20:65:6d:61:69:6c:20:75:73:2c:20:63:68:61:6e:67:65:20:74:68:65:20:73:75:62:6a:65:63:74:20:74:6f:20:22:54:68:61:74:27:73:20:61:6c:6c:20:79:6f:75:20:67:6f:74:3f:22:20:61:6e:64:20:79:6f:75:72:20:72:65:73:75:6d:65:20:77:69:6c:6c:20:6d:61:6b:65:20:69:74:20:74:6f:20:74:68:65:20:74:6f:70:20:6f:66:20:74:68:65:20:72:65:76:69:65:77:20:73:74:61:63:6b

2) What it decoded to looks like a bunch of 2 digit hexadecimal numbers separated by a colon. The following program converts this to an ascii string.


Here is the answer:
When you email us, change the subject to "That's all you got?" and your resume will make it to the top of the review stack
Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1007
    
    3
I'm disappointed... the hex-to-character decoding didn't use EDCDIC?

BTW, Integer.parseInt(hexCode, 16);

Ryan McGuire
Ranch Hand

Joined: Feb 18, 2005
Posts: 1007
    
    3
Ryan McGuire wrote:I'm disappointed... the hex-to-character decoding didn't use EDCDIC?


Before anyone else points it out...
s/EDCDIC/EBCDIC/

Nothing worse than a typo when you're trying to show off.
Ashish L. Sharma
Greenhorn

Joined: Mar 03, 2012
Posts: 16

Dave Trower wrote:Here are the steps to decode:
1) Go to a base 64 base decode website. There are several, but I went to http://www.opinionatedgeek.com/dotnet/tools/base64decode/
I copied what you put in this post and it decoded to this:
57:68:65:6e:20:79:6f:75:20:65:6d:61:69:6c:20:75:73:2c:20:63:68:61:6e:67:65:20:74:68:65:20:73:75:62:6a:65:63:74:20:74:6f:20:22:54:68:61:74:27:73:20:61:6c:6c:20:79:6f:75:20:67:6f:74:3f:22:20:61:6e:64:20:79:6f:75:72:20:72:65:73:75:6d:65:20:77:69:6c:6c:20:6d:61:6b:65:20:69:74:20:74:6f:20:74:68:65:20:74:6f:70:20:6f:66:20:74:68:65:20:72:65:76:69:65:77:20:73:74:61:63:6b

2) What it decoded to looks like a bunch of 2 digit hexadecimal numbers separated by a colon. The following program converts this to an ascii string.


Here is the answer:
When you email us, change the subject to "That's all you got?" and your resume will make it to the top of the review stack


Hats Off to you Sir Great Code !!!


Thanks,
Ashish :P
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is this riddle?