1. Two-square Cipher encoder
Text : ABCD efghi
Key1 : key
Key2 : word
Padding Character : zSolution:The Two-Square Cipher is a digraph substitution cipher, which uses two grids to enctypt the message
Key1 = keyabcdfghilmnopqrstuvwxz
Key2 = wordabcefghiklmnpqstuvxyz
Grid-1 | 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-2 | 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 |
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 : For each bigram, find first letter in Grid-1 and second letter in Grid-2
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,c4), b(G2,r2,c1) `=>` w(G2,r1,c1), g(G1,r2,c4) `=` wg
cd `=` c(G1,r2,c1), d(G2,r1,c4) `=>` f(G2,r2,c4), k(G1,r1,c1) `=` fk
ef `=` e(G1,r1,c2), f(G2,r2,c4) `=>` d(G2,r1,c4), d(G1,r2,c2) `=` dd
gh `=` g(G1,r2,c4), h(G2,r3,c1) `=>` b(G2,r2,c1), n(G1,r3,c4) `=` bn
iz `=` i(G1,r3,c1), z(G2,r5,c5) `=>` m(G2,r3,c5), u(G1,r5,c1) `=` mu
| Plaintext | : abcdefghiz |
| Ciphertext | : wgfkddbnmu |
2. Two-square Cipher encoder
Text : hello world
Key1 : key
Key2 : word
Padding Character : zSolution:The Two-Square Cipher is a digraph substitution cipher, which uses two grids to enctypt the message
Key1 = keyabcdfghilmnopqrstuvwxz
Key2 = wordabcefghiklmnpqstuvxyz
Grid-1 | 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-2 | 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 |
Plaintext = helloworld
Split into pairs of letters (digraphs)Pairs : he ll ow or ld
Encryption : For each bigram, find first letter in Grid-1 and second letter in Grid-2
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,c5), e(G2,r2,c3) `=>` e(G2,r2,c3), h(G1,r2,c5) `=` eh
ll `=` l(G1,r3,c2), l(G2,r3,c4) `=>` l(G2,r3,c4), l(G1,r3,c2) `=` ll
ow `=` o(G1,r3,c5), w(G2,r1,c1) `=>` h(G2,r3,c1), b(G1,r1,c5) `=` hb
or `=` o(G1,r3,c5), r(G2,r1,c3) `=>` k(G2,r3,c3), b(G1,r1,c5) `=` kb
ld `=` l(G1,r3,c2), d(G2,r1,c4) `=>` l(G2,r3,c4), e(G1,r1,c2) `=` le
| Plaintext | : helloworld |
| Ciphertext | : ehllhbkble |
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then