1. Playfair Cipher encoder
Text : ABCD efghi
Alphabet25 : abcdefghiklmnopqrstuvwxyz
Padding Character : xSolution:The Playfair cipher is a digraph substitution cipher, that encrypts pairs of letters (digraphs) instead of a single alphabet
Alphabet = abcdefghiklmnopqrstuvwxyz
| 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 ix
Encryption : ab = a(1,1), b(1,2) `=>` b(1,2), c(1,3) = bc,
Letters on the same row (Replace each letter with the one to its right)
cd = c(1,3), d(1,4) `=>` d(1,4), e(1,5) = de,
Letters on the same row (Replace each letter with the one to its right)
ef = e(1,5), f(2,1) `=>` a(1,1), k(2,5) = ak,
Rectangle rule (Replace each letter with the one in its row, but in the other letter's column)
gh = g(2,2), h(2,3) `=>` h(2,3), i(2,4) = hi,
Letters on the same row (Replace each letter with the one to its right)
ix = i(2,4), x(5,3) `=>` h(2,3), y(5,4) = hy,
Rectangle rule (Replace each letter with the one in its row, but in the other letter's column)
| Plaintext | : abcdefghix |
| Ciphertext | : bcdeakhihy |
2. Playfair Cipher encoder
Text : hello world
Alphabet25 : abcdefghiklmnopqrstuvwxyz
Padding Character : xSolution:The Playfair cipher is a digraph substitution cipher, that encrypts pairs of letters (digraphs) instead of a single alphabet
Alphabet = abcdefghiklmnopqrstuvwxyz
| 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
Pad duplicate-lettersIf a pair has same letters, insert a padding letter between them, to avoid revealing doubled letters in the ciphertext
Pairs : he lx lo wo rl d
Pad at end, if necessaryIf one letter is left at the end, then pad to make it pair
Pairs : he lx lo wo rl dx
Encryption : he = h(2,3), e(1,5) `=>` k(2,5), c(1,3) = kc,
Rectangle rule (Replace each letter with the one in its row, but in the other letter's column)
lx = l(3,1), x(5,3) `=>` n(3,3), v(5,1) = nv,
Rectangle rule (Replace each letter with the one in its row, but in the other letter's column)
lo = l(3,1), o(3,4) `=>` m(3,2), p(3,5) = mp,
Letters on the same row (Replace each letter with the one to its right)
wo = w(5,2), o(3,4) `=>` y(5,4), m(3,2) = ym,
Rectangle rule (Replace each letter with the one in its row, but in the other letter's column)
rl = r(4,2), l(3,1) `=>` q(4,1), m(3,2) = qm,
Rectangle rule (Replace each letter with the one in its row, but in the other letter's column)
dx = d(1,4), x(5,3) `=>` c(1,3), y(5,4) = cy,
Rectangle rule (Replace each letter with the one in its row, but in the other letter's column)
| Plaintext | : helxloworldx |
| Ciphertext | : kcnvmpymqmcy |
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then