Saturday, July 17, 2010

Experiencing Cryptographic Puzzle

I am a beginner in software testing. I had extreme curiosity about software testing. Now I am enjoying my work as a software tester.

Our team lead gave us a link of a puzzle

I am going to share my experience about it. In the first puzzle there were 46 characters with spaces. I calculate the frequency of both encoded and decoded message. Then I was looking at the hint to find out the key. I was looking at the triangle shape, after trying sometime I look over the hints. Then I concentrate the frequencies of the letter. I found that in the original message – “THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG”, ‘S’ is missing and in the encoded message ‘Z’ is missing. This gave the clue and I assume ‘S’ as ‘Z’. Then I re-format the code with my idea – Offset= Position of ‘Z’ – Position of ‘S’. I found nothing interesting. Then I concentrate on finding two ‘THE’s. It was not caught by my eyes yet. Then I started writing the words with my formulated value. I found nothing yet!! I was supposed to give up finding. Then for the last time I started reading my code and searching the value in the encrypted message. There it is!! I found the message.

For the second puzzle it was also a challenging one. When I saw the challenge, it was already discovered! But I still tried to find out the decrypted message with my own idea. I have searched in google to find out pangrams. I have found many but selected some that will help me solve the puzzle. As in the encrypted message there are 41 letters. I remove those pangrams those are more than 41 letters.
  1. Big Fuji waves pitch enzymed kex liquor. (33 letters + 6 spaces)
  2. The quick brown fox jumps over a lazy dog. (33 letters + 8 spaces)
  3. Pack my box with five dozen liquor jugs. (32 letters + 7 spaces)
  4. Jackdaws love my big sphinx of quartz. (31 letters + 6 spaces)
  5. The five boxing wizards jump quickly. (31 letters + 6 spaces)
  6. How quickly daft jumping zebras vex. (30 letters + 6 spaces)
Now I have analyzed the frequencies of the letter. I have discarded the second pangram as Ben Kelly said that it’s another pangram. I consider 1 and 3 using my previous puzzle experience. He used there 2 dummy characters in the cipher before starting the original message. I was not sure about this. Now I’ve narrowed to two messages. I am not sure, whether I’m going to the right path or not. Now I’ve to find out the key. In the previous message he used 7 as offset value. I was thinking about the idea behind taking the offset value. I thought he considered the triangle as a rectangle triangle and according to Pythagorean Theorem square of hypotenuse of the triangle is the summation of the square of other two sides. I read about this in book regarding cryptography, that Pythagorean Theorem is used to make ciphers. I’ve found 5, 4, 3 letters in the sides of the triangle, I thought Ben took the offset adding the two sides (4 & 3) counts. Another thing is, in that code there are 9 blank spaces so, it thought it can be 9-2=7. For the new code, offset values I’ve taken considered are –
  • Length of the both sides of the rectangle – 10 & 4
  • Length of the max side – 11
  • Count of blank spaces (14-2) - 11
I found the pangrams taking offset value as 11!! I was wrong. The offset was not 11. It's 8. I did a mistake while listing the letter with offset value. I found the value by mistake! But it was not correct one. When I read Ben’s post, I came to know that my approach was pretty lengthy. He took a simple step- just the difference of starting two character’s position is the offset!!
I was really a great experience solving the puzzle. The lesson I have learn are -
  • Focus and defocus on the item what you are looking for.
  • Think simple and take simple step to explore the module.
  • Of course have some basic knowledge about the thing you are testing.
  • Utilize your previous experience of testing.
Thanks to Ben Kelly and Sajjadul Vaiya to appreciate my work.