Playfair

This is a cipher system devised in the 19th century and used in World War I, but easy to crack by modern standards. It uses a codeword normally constructed from a word or phrase with no repeated letters.

In a Playfair code-square the codeword (in which no letter recurs) is followed by the remaining letters of the alphabet, usually in conventional order, with I doing duty for I and J. The codeword is QUESTIONMARK in the example shown below.

QUEST
IONMA
RKBCD
FGHLP
VWXYZ

A word to be encoded is first split into pairs of letters, CONTENTS becomes CO NT EN TS. When the letters of a pair appear at opposite corners of a rectangle, each is replaced by the letter at the other corner in the same row: CO → KM (while OC → MK), NT → AE. When they appear in the same row or column, each moves one place right or down, respectively: EN → NB. In these cases, letters at the right or bottom of the square move to the start of the corresponding row or column: TS → QT. Finally, the new pairs are assembled to give the encoded form: CONTENTS → KMAENBQT.

In some cases a word or phrase with repeated letters is chosen, in which case second and subsequent occurrences of a letter are omitted to form the codeword. Thus, EXCLAMATION MARK would lead to EXCLAMTIONRK.