# Trithemius cipher

- Description
- Algorithm
- Implementation

The Trithemius cipher was one of many polyalphabetic ciphers designed to be easy in frequent use. Instead of using random combinations of alphabet letters, Trithemius proposed using a special table. After some time the table was named tabula recta.

The first row contains all alphabet letters in the original order. Next rows also contain all letters but in each row they are shifted to the left by one position. The table has 26 rows and 26 columns (there are 26 letters in the Latin alphabet).

During encryption, subsequent plaintext letters are replaced by relevant letters from subsequent rows of the table. After using the last row, one should move back to the first row. It means that all plaintext letters are increased by number of positions determined by the actual row. Therefore the first letter is encrypted without shift, the second letter with the shift determined by the second row (so by one position), the third letter with the shift determined by the third row (so by two positions) and so on.

For example, a word MACHINE encoded using the cipher would create ciphertext MBEKMSK.

The Trithemius cipher does not have a secret keyword that protects ciphertext. To guess an original message, it is enough to know that this particular cipher has been used. Furthermore, one may assume that the Trithemius cipher is a particular case of Vigenère encryption - using the following key: ABCDEFGHIJKLMNOPQRSTUVWXYZ.