Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

This is a high level question.

One area of computer science that I'm working on getting better at is encoding and decoding data. My background is that of a self-taught web engineer who is trying to shore up weak areas of knowledge.

One type of question you get asked during interviews or that comes up in certain types of application development is that of data decoding. You'll get a chunk of data and need to unlock it like a Chinese puzzle box to find out what's inside.

As an example of one of these I was doing for fun a couple days ago, there was a chunk of data. By studying the character set, I could determine it was base32 encoded. From there (and this took a few hours of poking on my part to discover), if you looked at the binary representation of the data you could see some bit shifting was needed to get the values into ascii range. This led me to implement my own javascript base32 decoder as practice and to refine it to be pretty efficient. Turned out to be pretty fun.

Gist here: https://gist.github.com/geuis/6086349

Another one I randomly found tonight is clearly hex encoded. It doesn't directly decode into anything legible. I've looked at it from many angles such as reversing the hex string, reversing the bits in the decoded string, grouping by bits from 2 to 8, grouping by bits and shifting left/right, etc. Basically I've tried a variety of things to try and get some sensible data out but I haven't actually gotten anywhere.

So that's the high level question. What kinds of approaches should a person take to decoding a piece of unknown data? Clearly recognizing the character set is probably the first thing. But after that, is there a general rule of thumb(s) that you should take to breaking down the problem?

Thanks for tips and advice!

share
    
You need to draw a distinction between encoding and encryption... they're quite different. Decoding an encoded string is (usually) trivial. Decrypting ciphertext without any knowledge of the algorithm/mode/padding/plaintext/key is generally not practical. Your question is far too broad - there are so many forms of cryptanalysis that you really need to start investigating them, and ask specific questions as they arise. Good luck! –  hunter Jul 28 '13 at 14:37
1  
This was migrated from programmers.stackexchange.com, but this really does not belong here. –  nightcracker Jul 28 '13 at 15:52
1  
I agree with @nightcracker. This question doesn't belong in cryptography, which is why I posted it in Programming. I think the mistake was that I tagged it as "encryption", which was simply because it was the closest related term I could think of. –  Geuis Jul 28 '13 at 22:11
    
@Geuis, unfortunately I can't migrate it back. I guess you'll have to repost there. –  mikeazo Jul 29 '13 at 12:55
    
This question appears to be off-topic because it is about encoding/decoding, not cryptography. –  mikeazo Jul 29 '13 at 12:55
comments disabled on deleted / locked posts

migration rejected from programmers.stackexchange.com Jul 29 '13 at 12:55

This question came from our site for professional programmers interested in conceptual questions about software development. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by hunter, nightcracker, rath, Reid, mikeazo Jul 29 '13 at 12:55

  • This question does not appear to be about cryptography within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.