# Running Key Cipher

##### Ludovic Rembert
Last Updated on August 11, 2021

Cryptography is composed of several types of ciphers, one of which is a group of polyalphabetic substitution ciphers. These ciphers make use of several substitution alphabets to increase the complexity compared to a classic substitution cipher.

The running key cipher falls into this group, and it is quite similar to the Vigenère cipher as it uses a distinct tableau of substitution alphabets called the tabula recta which is a 26×26 table.

While the Vigenère cipher uses a repeating key, the running key cipher uses a keystream which is a long piece of text, often chosen from an agreed-upon book between the coder and receiver. This keystream is called the “running key” which is what’s used to encrypt the plain text.

## Cipher Example

To use the running key cipher, you’ll need the tabula recta which is made up of the English alphabet in the columns and rows. For the below example, using The C Programming Language, the running key will be “errors can occur in several places. A label…”. The plaintext will be “we must escape”

This running key will be placed underneath the plaintext in a table as such:

PLAINTEXTWEMUSTESCAPE
RUNNING KEYERRORSCANOCU

Next, to encrypt the plaintext, match up each character in the plaintext with the corresponding running key character in the tabula recta to find the cipher character. This is seen below.

PLAINTEXTWEMUSTESCAPE
RUNNING KEYERRORSCANOCU
CIPHERTEXTAVDIJLGSPORY

Thus, our plaintext of “we must escape” is encrypted to be “avdijlgspory”. The receiver of this ciphertext can then use the same running key to figure out the original plaintext.

### Cryptanalysis

Polyalphabetic ciphers can be difficult to crack given a few circumstances. For the running key cipher, if the running key is a once-used, random string of characters, decrypting a ciphertext is secure.

However, that isn’t how the running key cipher works normally.

The running key is often a string of words in a common language which reduces security.

Nonetheless, the running key cipher is more difficult to crack than other similar cipher such as the Vigenère cipher and autokey cipher.

To break the cipher, a cryptanalyst can guess chunks of the plaintext until a seemingly intelligible chunk is found. From there, the key may be able to be cracked. To crack the cipher using software, one needs to use higher-order language models.

### The Bottom Line

The running key cipher is a great example of encryption with a polyalphabetic substitution cipher. It makes use of the tabula recta which adds a degree of complexity for anyone who wants to decrypt your ciphertext.

Nonetheless, with modern technology, the cipher cannot provide enough security for utility. If you’re worried about security and online safety, learn more about online privacy from Privacy Canada.