# Reverse Engineer These Five Ciphers

This is the latest material I have made for my Codes and Ciphers club. It involves showing both the ciphertext and the plaintext for messages using each of five ciphers alongside another ciphertext that uses the same cipher (the process and the key are identical).

1.1.1/GERAIHSCMASTISEETSES
1.1.2/RBOOTMYOOIKRYAFCE
1.2.1/this is a secret message
1.2.2/UNDEFINED/DIFF.3
2.1.1/RELOCATED
2.1.2/RELOCATED
2.2.1/we do not care for those people and their reckless sense of unchecked optimism
2.2.2/UNDEFINED/DIFF.3
3.1.1/XTVZMGBKVESQXYCEWGAYEMBRFWNMQEXYKMHJHKFZS
3.1.2/YMKPOQYYSZWPTRVLHUXPZOVGLRFUCETW
3.2.1/every time we deal with an enemy we create two more
3.2.2/UNDEFINED/DIFF.1
4.1.1/4423.1544.1532.3244.4415.1144.2315.3232.4412.5545.2315.4415.1144.2335.4315
4.1.2/3355.4435.3413.1132.3251.3353.1144.1235.4334.2434.3435.5215.3312.1543
4.2.1/she sells sea shells by the sea shore
4.2.2/UNDEFINED/DIFF.1
5.1.1/10100.11100.11201.22202.32213.32214.43215.44316.44417.55417.56418.56429.57540.67651.68652.69752.70852.80852.80853.91854.91964.93075.103085.104086.114186
5.1.2/110.1221.11321.12321.12322.12422.22533.22534.32545.42556.42657.43767.53867.63967.65078.75088.76199.86210.96221.97331.97432.108432.118532
5.2.1/they say mexico will pay for it
5.2.2/UNDEFINED/DIFF.2


Hint 1

Using the first cipher, "nothing beats waffles" becomes "sftgtonaaehnibsewfl".

Hint 2

Each "key" in the second cipher is meaningful, but not every part of each key is meaningful.

Cipher #1 (from @Gareth McCaughan's answer)

Solution:

I TOOK MORAY BY FORCE

Cipher #2 (from @Gareth McCaughan's answer)

Solution:

I WAS APPOINTED MARSHAL OF MORAY

For reasoning for the above two solutions, see Gareth's answer.

Cipher #3

How to decipher:

It is a regular Vigenére cipher. We can try what is the key/passphrase being used by inserting the letters one-by-one until the prefix match. The key/passphrase for this one is "TYRION".

The secret message:

Fothad fabricated the rights to Moray.

Cipher #4

How to decipher:

Create this table:

A B C D E
F G H I J
K L M N O
P Q R S T
U V W X Y
Then for every two digits, it tells the pair of row and column. So, "4423.1544" is "SHES".

The secret message:

My son Callum was born in November.

Cipher #5

How to decipher:

If you separate each number by dots, try to subtract the next one with the previous one. So "10100.11100.11201.22202.32213" will result in "10100.1000.101.11001.10011".

After that, we can just decode the binary to number in alphabet, so "10100.1000.101.11001.10011" will be "THEYS".

The secret message:

• Great job so far :) With 5 you are probably getting an error because they weren't intended to be formatted specifically as ASCII - just convert them to decimal numbers and then read them as A1Z26. Sep 6, 2019 at 3:15
• @JoshuaBizley Yeah, I was mistaken to convert it to ASCII but A1Z26 instead >< However the first two numbers on 5.1.2. when subtracted is not in binary, is it intended? Sep 6, 2019 at 3:21
• Oh no sorry the first number should be 110 not 100... ugh when I copy-pasted the numbers into excel it missed the first line and I trusted myself to be able to read one number. Sep 6, 2019 at 3:27
• 2 down! By the way I have been telling a Crusader Kings 2 story with my weekly club challenges so "Ross" is the county in Scotland. Sep 6, 2019 at 3:33

3,4,5 have already been done. Here's #1.

Plaintext:

I TOOK MORAY BY FORCE

Mechanism:

This is a transposition cipher. Number the letters of the plaintext from 1. Start at the last position that's 3 mod 4 (in the cases here that's 19 or 15) and take every 4th letter backwards until reaching position 3. Then start at position 2 and take every 4th letter forwards until reaching the end of the plaintext. Now start at position 4 and repeat the following pattern for ever, just ignoring any positions lying off the end of the plaintext: back 3, forward 4, forward 3, forward 4.

And for #2, the plaintext:

I WAS APPOINTED MARSHAL OF MORAY

and the mechanism:

For each "box" in reading order, look only at its outside; we have some key "tops" at top and right, and some key "bottoms" at bottom and left. Join those together (discarding any without partners). What we have is a simple substitution cipher where each of these represents a letter. If there is any pattern to this representation then I have failed to discern it, but fortunately all but one of the keys appearing in the unknown ciphertext also appear in the known ciphertext, and seeing "I WAS APPOINTED MARSHAL OF MORA_" there's not much choice for how to fill in the blank, especially considering the general theme here.

Some clarification:

It may not be obvious how to "join those together", so let's look at the first box of the ciphertext whose plaintext is known. Reading along the top and bottom, we have key-tops that go 3/2, 3/1, 2/2 (above the box) and 0/1, 1/0, 1/0 (below the box). At the right of the box we have a key-top 3/2, and at the left we have a key-bottom 1/1. We ignore all the key-parts inside the box, though some of them will be relevant when looking at other boxes. Pair up the key-parts lying opposite one another, as if each key extended through the box. So we have 3/2+0/1; 3/1+1/0; 2/2+1/0, and then 3/2+1/1. These, in this order, are the first four symbols of the ciphertext, and they happen to correspond to letters WEDO. You may notice that the second pair in the second box is 3/2 (above) + 1/1 (below), the same as the fourth pair in the first box, which is good because the plaintext begins WEDONO...

• Excellent work! Sep 7, 2019 at 22:33
• Hey Gareth, you are on the right track. Honestly very surprised you haven't found it with 12 approaches. I have double checked and you should definitely notice the symbols aligning with "we do not care for..." with what I consider one of the most obvious "ways of decoding". Sep 12, 2019 at 15:20
• It's extremely possible that I've just done something stupid! I'll take another look (but not right now since I'm at work :-) ). Sep 12, 2019 at 15:44
• I've added some more explanation. Braille is an ingenious idea, but if it helps here I don't see how. (What seem to me the most obvious ways to try to interpret the "keys" as signifying Braille don't look like they work.) Sep 15, 2019 at 2:44
• That difficulty is very common when setting puzzles composed of multiple independent pieces. The solution is that you should do whatever you feel like :-). Sep 15, 2019 at 11:09