Lesson 4
Grilles
Grilles are best thought of as pieces of cardboard with holes cut into them in a specific pattern. This lesson we’ll be looking at two ways that grilles can be used.
In the below example, the Grille is placed over a seemingly random grid of letters to reveal the message (”Teapots”) in the holes. This is a very simple method of hiding a message and relies on the Grille and the grid it fits on being kept completely separate. If the Grille was provided in a different orientation (e.g. rotated 90 or 180 degrees) it could make this message at least a bit more awkward to solve :)
Grilles are best thought of as pieces of cardboard with holes cut into them in a specific pattern. This lesson we’ll be looking at two ways that grilles can be used.
In the below example, the Grille is placed over a seemingly random grid of letters to reveal the message (”Teapots”) in the holes. This is a very simple method of hiding a message and relies on the Grille and the grid it fits on being kept completely separate. If the Grille was provided in a different orientation (e.g. rotated 90 or 180 degrees) it could make this message at least a bit more awkward to solve :)
Grilles can also be used in a columnar cipher fashion. You simply place a Grille on an empty grid and then write the letters of the plaintext in the gaps (from left->right, top->bottom). After this you read off the letters in columns (from top->bottom, left->right), as per the below example where “Meg likes pies” is entered into the gaps in the Grille (the gaps being represented by black squares) and the encrypted message becomes: “GMKPIEESLIE”. (The word pie showing up here is actually just an unfortunate fluke by the way).
----------------------------
Bacon’s Cipher
In this "cipher" the message is simply concealed in how the text is presented.
In this "cipher" the message is simply concealed in how the text is presented.
This is the most standard presentation of the Bacon cipher. However, it could be used with the letters ‘C’ and ‘D’ in there, or ‘O’ and ‘U’ or 2 different colours, fonts, sizes etc. You could even use a mix of capitalised and non-capitalised letters for it. Each letter still maintains it’s own unique ‘code’ which identifies it however.
Using the above table, the word ‘hello’ would be translated as below:
AABBB AABAA ABABA ABABA ABBAB
By rearranging the arrangement of the letters the code can be disguised slightly:
AAB BBA ANA AAB ABA ABA BAA BBA B.
By using a mix of capitals and normal letters (A is translated into lower case and B is translated into capitals) the code can be, perhaps, better hidden:
my NAMe iS mayA aNd i LiKe gREeN.
Decoding is simple, the text needs to be divided up into groups of five and the only thing you have to work out is what represents A and what represents B. The message is considered as hidden rather than encoded as any cover text of the right length (a multiple of 5 ideally) can be used to disguise the message in some way or form.
Yes, this is painful to look at, but it is somewhat better hidden than simply a mixture of A and B letters.
Using the above table, the word ‘hello’ would be translated as below:
AABBB AABAA ABABA ABABA ABBAB
By rearranging the arrangement of the letters the code can be disguised slightly:
AAB BBA ANA AAB ABA ABA BAA BBA B.
By using a mix of capitals and normal letters (A is translated into lower case and B is translated into capitals) the code can be, perhaps, better hidden:
my NAMe iS mayA aNd i LiKe gREeN.
Decoding is simple, the text needs to be divided up into groups of five and the only thing you have to work out is what represents A and what represents B. The message is considered as hidden rather than encoded as any cover text of the right length (a multiple of 5 ideally) can be used to disguise the message in some way or form.
Yes, this is painful to look at, but it is somewhat better hidden than simply a mixture of A and B letters.
------------------------------
Polybius Square
Needless to say this method uses a square to hide the message.
Needless to say this method uses a square to hide the message.
As you may have noticed, as there are 26 letters in the alphabet and 26 are required for a square, the letters I and J have been combined in the same square.
Using this method the word ‘hello’ becomes:
23 15 31 31 34
Note, I first took the number of the row of the letter (horizontally) and then the number of the column (vertically).
Using this method the word ‘hello’ becomes:
23 15 31 31 34
Note, I first took the number of the row of the letter (horizontally) and then the number of the column (vertically).
--------------------------
ROT-13 / ROT-47
We'll be finishing by returning to a couple of additional substitution ciphers. ROT-13 itself is actually a very simple substitution letter where the first half of the alphabet is paired with its equivalent in the second half of the alphabet - i.e. it's split into 2 sets of 13 as shown below. The first 13 runs from A-->M, the second 13 runs from N-->Z.
We'll be finishing by returning to a couple of additional substitution ciphers. ROT-13 itself is actually a very simple substitution letter where the first half of the alphabet is paired with its equivalent in the second half of the alphabet - i.e. it's split into 2 sets of 13 as shown below. The first 13 runs from A-->M, the second 13 runs from N-->Z.
So the word CAKE would become PNXR. The word ENVY actually becomes RAIL and RAIL would encrypt to ENVY. Etc.
ROT-47 is slightly more complicated because it uses the 94 ASCII characters from ! through to ~ as shown below. Yes, we seem to be missing a capital O, never mind. Just use the small o >_>
ROT-47 is slightly more complicated because it uses the 94 ASCII characters from ! through to ~ as shown below. Yes, we seem to be missing a capital O, never mind. Just use the small o >_>
So, with ROT-47 the case of a letter can be changed too (or used to complicate things more). For example, if the case of the letter in the plaintext is irrelevant, CAKE could be encrypted as 42<6 or as rpzt or 4p<t etc.
----------------------
Playfair cipher
Again we'll go with learning by example. This one has a few little rules to understand but isn't that complicated once you know them :)
1. Pick a keyword. In this case I have chosen: MARZIPAN which ignoring double letters will become: MARZIPN.
2. Using the keyword first, write your alphabet out into a 5x5 grid. Like the Polybius square, we'll use I/J in the same square.
Again we'll go with learning by example. This one has a few little rules to understand but isn't that complicated once you know them :)
1. Pick a keyword. In this case I have chosen: MARZIPAN which ignoring double letters will become: MARZIPN.
2. Using the keyword first, write your alphabet out into a 5x5 grid. Like the Polybius square, we'll use I/J in the same square.
3. Now we'll choose our plaintext message. For the purpose of continuity we'll go with "I REALLY LIKE CAKE."
4. Split the ciphertext into pairs. Note it has been filled out with an X (you can pick any letter) as it had an odd number of letters.
IR EA LL YL IK EC AK EX
5. Each pair of letters is encrypted together.
Taking the IR:
4. Split the ciphertext into pairs. Note it has been filled out with an X (you can pick any letter) as it had an odd number of letters.
IR EA LL YL IK EC AK EX
5. Each pair of letters is encrypted together.
Taking the IR:
- Locate both letters on the grid.
- In this case the letters are on the same row.
- Therefore, you replace each letter with the letter immediately to its right within the row. I.e. the "I" would become an "M" (you just continue looping within the row) and the "R" would become "Z."
- Overall: IR --> MZ
Taking the EA:
- Locate both letters on the grid.
- In this case the letters form a rectangle.
- Therefore, we take the letters in the opposite corners of the rectangle.
- As E came first, we encode it first and replace it with the opposite corner on the same row. "E" --> "F."
- The A was second, so we encode it second. It is replaced with the letter in the opposite corner on the same row as it. I.e. "A" --> "M."
- Overall: EA --> FM
Taking the LL:
The remainder of the plaintext is: YL IK EC AK EX
YL is easy - it's another rectangle --> UT.
Taking the IK:
For the remaining pairs:
EC --> HP
AK --> JF (or IF, I've chosen J)
EX --> HU
Our ciphertext becomes: MZ FM SU SU UT DT HP JF HU. Obviously we can take the spaces out to make it less obvious they were encoded in pairs :)
Encoding
In summary...follow these rules:
Decoding
Follow these rules:
- Well, we have 2 of the same letter. In this case you can either do nothing, and just make LL --> LL. Or you can split LL into LX LX (using the X to split it up) and encode from there.
- With the second option, LX forms a rectangle so would become SU.
- Overall: either LL --> LL or LL --> SU depending on which method you choose. I'll take LL -> SU because it disguises it a bit better.
The remainder of the plaintext is: YL IK EC AK EX
YL is easy - it's another rectangle --> UT.
Taking the IK:
- These two letters are in the same column.
- We take the letter directly below each letter, again, we encode the "I" first as it's first in the plaintext.
- The column again loops around so if we were encoding "TY" the "T" would become "Y" and the "Y" would loop around to become "I/J."
- In this case "I" --> "D" and "K" --> "T."
- Overall IK --> DT
For the remaining pairs:
EC --> HP
AK --> JF (or IF, I've chosen J)
EX --> HU
Our ciphertext becomes: MZ FM SU SU UT DT HP JF HU. Obviously we can take the spaces out to make it less obvious they were encoded in pairs :)
Encoding
In summary...follow these rules:
- Split the plaintext into pairs of letters.
- If you have a pair of identical letters, either leave them as they are or pad them out with X's - i.e. EE --> EX EX.
- Find each pair of letters on the grid.
- You always encode the first letter in the plaintext first.
- If the pair of letters form a rectangle, use the letters from the other corners of the rectangles.Each letter is replaced with the letter from the opposite corner on the same row.
- If the pair of letters are on the same row, replace each letter with the letter directly to its right (loop within that row or imagine the row repeats over and over, e.g. for the lesson, treat line 1 as MARZIMARZI - i.e. you replace I with M as M is to its right).
- If the pair of letters are in the same column, replace each letter with the letter directly below it (again loop the column).
Decoding
Follow these rules:
- Split the ciphertext into pairs of letters.
- Find each pair of letters on the grid.
- You always decode the first letter in the ciphertext first.
- If the pair of letters form a rectangle, use the letters from the other corners of the rectangles.Each letter is replaced with the letter from the opposite corner on the same row.
- If the pair of letters are on the same row, replace each letter with the letter directly to its LEFT.
- If the pair of letters are in the same column, replace each letter with the letter directly ABOVE it.
----------------------
Time to move onto the final ASSIGNMENT.