Tuesday, April 5, 2022

Bonus Post: Cipher Solved

Last Tuesday I posted a cipher. I had realized that it was vulnerable to letter frequency analysis, but there were a couple of “tricks” in there that I was hoping would slow down anyone trying to solve it.

It didn’t slow Buzz down. Late Saturday night I got a message from him:

…I found chapter 31 and 32 of Treasure Island!

I did this by working with pairs of letters, finding the highest frequencies, mapping those pairs into an a-z grid. The number that I mapped stayed within certain rows and columns and I saw enough of a pattern. Without filling in the rest I ran the encoded text against the grid I had, using underscores for the rest. That resulted in:
_ji_m__s_aid_s_ilv_erw_he__nw_e__wer__ea_l__o_nei_f_is_a__v__e__d…

With the underscores removed and the proper spaces added, that reads:

jim said silver when we were alone if i saved…

How It Works

  • Case doesn’t matter. That was just thrown in to add “noise.”
  • Each letter in the original text is represented by two letters in the cipher.  The first letter of the letter pair indicates what to do with the second letter:
    • If the pair begins with A through F (inclusive) that letter pair is ignored.
    • If the pair begins with G through M the second letter is shifted backwards by two letters if the first letter is G, four letters if the first letter is H, six letters for I, etc. Examples:
      • GE = C
      • GF = D
      • HE = A
      • HF = B
    • If the pair begins with N through T the second letter is shifted forward by two letters if the first letter is N, four letters if the first letter is O, six letters for P,etc. Examples:
      • NT = V
      • OT = X
    • If the pair begins with U through Z that letter pair is ignored.
Buzz made this chart, but he missed the T’s.


What’s Next?

I might make another cipher. Buzz doesn’t have time to crack it, but I enjoy making them.

Oh, and I owe Buzz a beer or something.

No comments:

Post a Comment

Unfortunately, we've had a recent increase in spam. To address this, I've turned on comment moderation for posts that are over a week old. You can still comment (please do!), but the comment might be invisible until I make it public. This will usually be within 24 hours. Sorry.