# A Magical Cryptography Puzzle

The following is the first and second sentences of one of my favorite (and fairly popular) fantasy books encoded in a cipher I created a few years ago. I'm quite certain it's breakable, but hints/more sample text may be needed to solve it. Partial solutions are welcome. Good luck!

Bonus if you can determine the book's title from its first couple sentences.

Hint 1: (and this is a big one!)

This cipher uses two 5x5 Polybius grids of my own creation. See here for a sample grid. One of them is used somewhat rarely in this text, but it is QUITE obvious when.

Hint 2:

As hinted at before, one Polybius grid is used for encrypting letters, and another is used for spaces and punctuation. The second grid results in UPPERCASE letters, while the first results in the more common lowercase letters. The main challenge that remains is to determine how the coordinates of the grids work.

Hint 3:

You may notice that different letters are represented by different combinations of symbols throughout the text - which is correct. However, the available letter combinations do not change. What I mean by this is that my options for giving the grid coordinates of an "E" (for example) are the same throughout the puzzle and do not change over time.

Hint 4:

In a letter (for example, "E") the second coordinate is always one of the following letters: afkpuz. What is the relationship between these letters? Check yourself by looking at the letters that can be found in the first coordinate of that letter: ejoty

• In the light of Dr Xorile's answer and your comment: Is the passage "... yyUpryyfcieaAAssofshexZmj ..." correct? – M Oehm Jan 14 '19 at 6:43
• @MOehm oh my goodness....well I fixed it. I must have been more tired than I thought last night...er two nights ago. Whatever. Thank you! – Brandon_J Jan 15 '19 at 13:42
• and quick note to everyone - the second sentence starts with "ydhvxlsi". Everything before that is part of the first sentence. – Brandon_J Jan 15 '19 at 14:32
• The first few letters look like "jr imm at a" The imm has two "m"s though… Not quite sure about that… maybe the capital are some sort of a key to the next part? – Yout Ried Jan 17 '19 at 16:19
• @YoutRied Good idea, but not quite the idea. jhbh's comment below is closer. – Brandon_J Jan 17 '19 at 16:57

I'm gonna take a random guess (well, not technically random), based on the number of words, and letters per word, that your favorite book is

The Chronicles of Narnia: The Lion The Witch And The Wardrobe

I'll try to decipher the encryption when I'll have time

Update:

Polybius grid 1:

. 1 2 3 4 5
1 a/z f k p u
2 b g l q v
3 c h m r w
4 d i n s x
5 e j o t y

Polybius grid 2:

. 1 2 3 4 5
1 space .
2 .
3 ,
4 -
5

By getting the row number and column number of the to-be-encrypted letter, we select a random letter within that row.

Example:
(1) Let's encrypt letter 'E', the row number is 5 and the column number is 1.
We then randomly(?) pick a letter in row 5, and pair it with a random(?) letter in row 1, thus getting the 'ep' pair as hinted.
(2) If you encrypt 'space', 'A', or 'Z', you choose both letter-pair from the first row, that's why most of the capital letters (space) can be found from the first row (A, F, K, P, U, Z).

I'm not sure if this is the right solution, but the process checks out. But if it is correct, we can't actually solve the problem/future problems unless we know the original message because of the random picking of letters.

My bad, it is solvable, was confused.

So, in the first pair, 'jr', we can see that 'j' is in row 5, and 'r' is in row 3. We can then get the original letter as 'o' because of it's coordinates, (row 5, column 3).
Second pair is 'im', getting row 4, column 3 = letter 'n'.
Doing it to all pairs, we get the first two lines of The lion, the witch and the wardrobe:

Once there were four children whose names were Peter, Susan, Edmund and Lucy.
This story is about something that happened to them when they were sent away from London during the war because of the air-raids.

• Bounty will come for the decipher-ing - great eye, BTW! – Brandon_J Jan 21 '19 at 14:23
• If this is correct, shouldn't the second word be 5 characters? @Brandon_J – LeppyR64 Jan 22 '19 at 12:34
• oh...crud...will look at that @LeppyR64 – Brandon_J Jan 22 '19 at 14:35
• Yeah, forgot to put that in my answer, one word was missing a character. Also, by any chance, does the encryption have anything to do with ASCII? Haha – ImongMama Jan 22 '19 at 18:04
• Nope, no ASCII. Also, looks like I forgot the second "e" in that word. – Brandon_J Jan 22 '19 at 19:20

A few observations (nowhere near a solution):

The letters come in pairs, with occasional pairs of upper case letter. The letter pairs are almost unique. "AF" comes up twice, as does "di" and "po". If you don't worry about case then you can include "po"/"PO" and "am"/"AM". Ah ha, you say. You've got them all reversed. True. I reversed the code because then it looks like words in CamelCase. But with double letters.

None of which gets me anywhere, I'm afraid...

• Rot13(Cnvef vf pbeerpg. Erirefvat gur zrffntr (be nal fbeg bs genafcbfvgvba) jvyy trg lbh abjurer.) – Brandon_J Jan 12 '19 at 2:14
• Rot13(vg ybbxf yvxr pncvgnyvmrq cnvef ner chapghngvba fhpu nf fcnprf naq crevbqf) – jhbh Jan 16 '19 at 14:20
• @jhbh on the right track! – Brandon_J Jan 17 '19 at 1:12