1. Four Square Cipher encoder
Text : ABCD efghi
Key1 : key
Key2 : word
Padding Character : zSolution:The Four Square Cipher is a digraphic substitution cipher, which uses four grids to enctypt the message
Key1 = keyabcdfghilmnopqrstuvwxz
Key2 = wordabcefghiklmnpqstuvxyz
Grid-1 | 1 | 2 | 3 | 4 | 5 |
| 1 | a | b | c | d | e |
| 2 | f | g | h | i | k |
| 3 | l | m | n | o | p |
| 4 | q | r | s | t | u |
| 5 | v | w | x | y | z |
Grid-2 | 1 | 2 | 3 | 4 | 5 |
| 1 | k | e | y | a | b |
| 2 | c | d | f | g | h |
| 3 | i | l | m | n | o |
| 4 | p | q | r | s | t |
| 5 | u | v | w | x | z |
Grid-3 | 1 | 2 | 3 | 4 | 5 |
| 1 | w | o | r | d | a |
| 2 | b | c | e | f | g |
| 3 | h | i | k | l | m |
| 4 | n | p | q | s | t |
| 5 | u | v | x | y | z |
Grid-4 | 1 | 2 | 3 | 4 | 5 |
| 1 | a | b | c | d | e |
| 2 | f | g | h | i | k |
| 3 | l | m | n | o | p |
| 4 | q | r | s | t | u |
| 5 | v | w | x | y | z |
Plaintext = abcdefghi
Split into pairs of letters (digraphs)Pairs : ab cd ef gh i
Pad at end, if necessaryIf one letter is left at the end, then pad to make it pair
Pairs : ab cd ef gh iz
Encryption : Rule : If both letters are on the same row or column then reverse them, otherwise use Rectangle rule (Replace each letter with the one in its row, but in the other letter's column)
ab `=` a(G1,r1,c1), b(G4,r1,c2) `=>` e(G2,r1,c2), w(G3,r1,c1) `=` ew
cd `=` c(G1,r1,c3), d(G4,r1,c4) `=>` a(G2,r1,c4), r(G3,r1,c3) `=` ar
ef `=` e(G1,r1,c5), f(G4,r2,c1) `=>` k(G2,r1,c1), g(G3,r2,c5) `=` kg
gh `=` g(G1,r2,c2), h(G4,r2,c3) `=>` f(G2,r2,c3), c(G3,r2,c2) `=` fc
iz `=` i(G1,r2,c4), z(G4,r5,c5) `=>` h(G2,r2,c5), y(G3,r5,c4) `=` hy
| Plaintext | : abcdefghiz |
| Ciphertext | : ewarkgfchy |
2. Four Square Cipher encoder
Text : hello world
Key1 : key
Key2 : word
Padding Character : zSolution:The Four Square Cipher is a digraphic substitution cipher, which uses four grids to enctypt the message
Key1 = keyabcdfghilmnopqrstuvwxz
Key2 = wordabcefghiklmnpqstuvxyz
Grid-1 | 1 | 2 | 3 | 4 | 5 |
| 1 | a | b | c | d | e |
| 2 | f | g | h | i | k |
| 3 | l | m | n | o | p |
| 4 | q | r | s | t | u |
| 5 | v | w | x | y | z |
Grid-2 | 1 | 2 | 3 | 4 | 5 |
| 1 | k | e | y | a | b |
| 2 | c | d | f | g | h |
| 3 | i | l | m | n | o |
| 4 | p | q | r | s | t |
| 5 | u | v | w | x | z |
Grid-3 | 1 | 2 | 3 | 4 | 5 |
| 1 | w | o | r | d | a |
| 2 | b | c | e | f | g |
| 3 | h | i | k | l | m |
| 4 | n | p | q | s | t |
| 5 | u | v | x | y | z |
Grid-4 | 1 | 2 | 3 | 4 | 5 |
| 1 | a | b | c | d | e |
| 2 | f | g | h | i | k |
| 3 | l | m | n | o | p |
| 4 | q | r | s | t | u |
| 5 | v | w | x | y | z |
Plaintext = helloworld
Split into pairs of letters (digraphs)Pairs : he ll ow or ld
Encryption : Rule : If both letters are on the same row or column then reverse them, otherwise use Rectangle rule (Replace each letter with the one in its row, but in the other letter's column)
he `=` h(G1,r2,c3), e(G4,r1,c5) `=>` h(G2,r2,c5), r(G3,r1,c3) `=` hr
ll `=` l(G1,r3,c1), l(G4,r3,c1) `=>` i(G2,r3,c1), h(G3,r3,c1) `=` ih
ow `=` o(G1,r3,c4), w(G4,r5,c2) `=>` l(G2,r3,c2), y(G3,r5,c4) `=` ly
or `=` o(G1,r3,c4), r(G4,r4,c2) `=>` l(G2,r3,c2), s(G3,r4,c4) `=` ls
ld `=` l(G1,r3,c1), d(G4,r1,c4) `=>` n(G2,r3,c4), w(G3,r1,c1) `=` nw
| Plaintext | : helloworld |
| Ciphertext | : hrihlylsnw |
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then