Running Key Cipher

Key Stream

Running Key Cipher is a type of polyalphabetic substitution cipher in which a text, typically from a book, is used to provide a very long keystream. The earliest description of such a cipher was given in 1892 by French mathematician Arthur Joseph Hermann (better known for founding Éditions Hermann). Usually, the book to be used would be agreed ahead of time, while the passage to be used would be chosen randomly for each message and secretly indicated somewhere in the message.

The Running Key Cipher has the same internal workings as the Vigenere Cipher. The difference lies in how the key is chosen; the Vigenere Cipher uses a short key that repeats, whereas the running key cipher uses a long key such as an excerpt from a book. This means the key does not repeat, making cryptanalysis more difficult. The cipher can still be broken though, as there are statistical patterns in both the key and the plaintext which can be exploited.

If the key for the running key cipher comes from a statistically random source, then it becomes a 'one time pad' cipher. One time pads are theoretically unbreakable ciphers, because every possible decryption is equally likely.

How it works?

The 'key' for a running key cipher is a long piece of text, e.g. an excerpt from a book. The running key cipher uses the following tableau (the 'tabula recta') to encipher the plaintext:

    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
    ---------------------------------------------------
A | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
B | B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
C | C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
D | D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
E | E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
F | F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
G | G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
H | H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
I | I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
J | J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
K | K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
L | L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
M | M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
N | N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
O | O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
P | P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
Q | Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
R | R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
S | S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
T | T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
U | U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
V | V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
W | W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
X | X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
Y | Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
Z | Z A B C D E F G H I J K L M N O P Q R S T U V W X Y

To encipher a message, write the key stream above the plaintext, in this case our key is from a Terry Pratchett book: 'How does the duck know that? said Victor'. If we needed to encipher a longer plaintext, we could just continue reading from the book.

HOWDOESTHEDUCKKNOWTHATSAIDVI
DEFENDTHEEASTWALLOFTHECASTLE

Now we take the letter we will be encoding, 'D', and find it on the first column on the tableau. Then, we move along the 'D' row of the tableau until we come to the column with the 'H' at the top (The 'H' is the keyword letter for the first 'D'), the intersection is our ciphertext character, 'K'.

So, the ciphertext for the above plaintext is:

HOWDOESTHEDUCKKNOWTHATSAIDVI
DEFENDTHEEASTWALLOFTHECASTLE
KSBHBHLALIDMVGKYZKYAHXUAAWGM

Featured Tools

Featured tools that you might find useful.

Popular Tools

List of popular tools that users love and frequently use.

New Tools

The latest tools added to our collection, designed for you.

Topics

The tools grouped by topics to quickly find what you need.
Scytale Cipher is a transposition cipher, which means it rearranges the order of letters in a message rather than substituting them with other characters.

Scytale Cipher

Scytale Cipher is a transposition cipher, which means it rearranges the order of letters in a message rather than substituting them with other characters.
Braille Cipher is a substitution cipher, it could encoding and substituting the letters in a message into

Braille Cipher

Braille Cipher is a substitution cipher, it could encoding and substituting the letters in a message into "Braille" characters.
Type 7 Cipher, also known as Cisco Type 7 Encryption, is a method commonly used by Cisco networking devices to obfuscate sensitive information such as passwords in configuration files. While it's referred to as encryption, Type 7 is actually a weak form of encoding designed to obscure passwords rather than securely encrypting them.

Type 7 Cipher

Type 7 Cipher, also known as Cisco Type 7 Encryption, is a method commonly used by Cisco networking devices to obfuscate sensitive information such as passwords in configuration files. While it's referred to as encryption, Type 7 is actually a weak form of encoding designed to obscure passwords rather than securely encrypting them.
The Vigenère Cipher is a method of encrypting alphabetic text where each letter of the plaintext is encoded with a different Caesar Cipher, whose increment is determined by the corresponding letter of another text, the key.

Vigenère Cipher

The Vigenère Cipher is a method of encrypting alphabetic text where each letter of the plaintext is encoded with a different Caesar Cipher, whose increment is determined by the corresponding letter of another text, the key.