Giovanbattista della Porta described this cipher in 1563, and it was one of the first practical polyalphabetic systems. Its defining trait is that it is reciprocal: there is no separate decrypt mode, because running ciphertext back through with the same keyword restores the plaintext.
How it works
Porta uses 13 alphabets, one for each pair of key letters (A/B, C/D, … Y/Z). Within every alphabet the first half of the letters (A–M) always maps into the second half (N–Z) and vice versa, with a shift determined by the key-letter pair:
row r = floor((keyLetter - 'A') / 2) (0..12)
if plaintext index i < 13: cipher = ((i + r) mod 13) + 13
else: cipher = (i - 13 - r) mod 13
Because A–M and N–Z are always exchanged, the function is its own inverse — the same key encrypts and decrypts.
Tips and example
With the keyword LEMON, the message ATTACK AT DAWN enciphers to
SEAUVP PA XTEL; feeding that ciphertext back in with LEMON returns the
original. Choose a long, non-dictionary keyword to make the repeating-key
pattern harder to spot, though be clear this is a historical cipher: it falls
quickly to classical cryptanalysis and is meant for puzzles and study, not real
secrets.