Playfair Cipher

Classical digraph substitution cipher. Educational use only.

Input

Reset

Rules (encode): split into digraphs; if a pair has same letters, insert pad after first; if odd length, pad the last. Same row: shift right. Same column: shift down. Rectangle: swap columns.

Key Square

ABCDE
FGHIK
LMNOP
QRSTU
VWXYZ

Output