Keyword Cipher Example: Decode Your Secrets

Benjamin Jul 11, 2026

In the ever-evolving landscape of data security, cryptography plays an indispensable role. One fascinating aspect of cryptography is the use of ciphers, which are algorithms that transform plaintext into an unreadable format. Today, we're going to delve into the world of keyword ciphers, a simple yet intriguing type of cipher that uses a keyword to encrypt and decrypt messages.

Codes
Codes

Keyword ciphers, also known as running key ciphers, are a type of polyalphabetic substitution cipher. They're called 'keyword' ciphers because they use a keyword to determine the order of the alphabet used for encryption. This method was famously used by the German military during World War I, with the keyword 'BERLIN' being a notable example.

Block Cipher
Block Cipher

How Keyword Ciphers Work

At the heart of a keyword cipher lies a simple yet effective process. Here's a step-by-step breakdown:

Secret language
Secret language

1. **Choose a Keyword**: The first step is to select a keyword. This keyword will be used to determine the order of the alphabet for encryption.

Preparing the Keyword

the printable alphabet worksheet for children to learn how to spell letters and numbers
the printable alphabet worksheet for children to learn how to spell letters and numbers

Once the keyword is chosen, it's written out in repeating cycles until it's as long as the plaintext message. For example, if your keyword is 'SECRET' and your message is 'ATTACKATDAWN', you'd write 'SECRETSECRETSECRETSECRE'.

Next, the keyword is combined with the alphabet to create a combined alphabet. Any letters that appear more than once in the keyword are removed from the alphabet. For instance, if your keyword is 'KEYWORD', the combined alphabet would be 'NHGJLMOPQRSTUVXYZ'.

Encrypting the Message

Clock Chipher
Clock Chipher

Now, to encrypt the message, you write out the combined alphabet in the order determined by your keyword. Then, you replace each letter of the plaintext with the corresponding letter from the combined alphabet. If a letter in the plaintext isn't in the combined alphabet, it's ignored.

For instance, using the keyword 'KEYWORD' and the plaintext 'ATTACKATDAWN', the encrypted message would be 'LXFOPVEFRNHR'.

Decrypting a Keyword Cipher

an image of a tree diagram with letters and numbers on the bottom right corner,
an image of a tree diagram with letters and numbers on the bottom right corner,

Decrypting a keyword cipher is essentially the reverse process of encryption. You need to know the keyword and the combined alphabet to decrypt the message.

First, you write out the keyword in repeating cycles, just like in encryption. Then, you replace each letter of the ciphertext with the corresponding letter from the combined alphabet, in the order determined by the keyword.

Cryptology - Encryption, Ciphers, Security | Britannica
Cryptology - Encryption, Ciphers, Security | Britannica
🔐 Secret Codes & Ciphers — unlock your inner spy.  From classic Caesar shifts to Morse code .
🔐 Secret Codes & Ciphers — unlock your inner spy. From classic Caesar shifts to Morse code .
an old book with some type of font and numbers on the pages, but it is not
an old book with some type of font and numbers on the pages, but it is not
Trio Code
Trio Code
a piece of paper that has some type of text on it, and the words are written
a piece of paper that has some type of text on it, and the words are written
an open book with some writing on it
an open book with some writing on it
a black and white typeface with the letters in different font styles, including one for each letter
a black and white typeface with the letters in different font styles, including one for each letter
code cypher
code cypher
the font and numbers are all in different styles, but there is no image to describe
the font and numbers are all in different styles, but there is no image to describe
Pigpen Cipher Font Free Download - Fonts Empire
Pigpen Cipher Font Free Download - Fonts Empire
an open book with some writing on it and the same page in front of it
an open book with some writing on it and the same page in front of it
two different types of letters and numbers are shown in the same font type as each other
two different types of letters and numbers are shown in the same font type as each other
the alphabet and numbers for dice players to play in their own game, which includes four different
the alphabet and numbers for dice players to play in their own game, which includes four different
Top 10 Codes and Ciphers
Top 10 Codes and Ciphers
a piece of paper that has some type of text in the bottom right hand corner
a piece of paper that has some type of text in the bottom right hand corner
Caesar Cipher Translator
Caesar Cipher Translator
Rail Fence Cipher Program in C and C++[Encryption & Decryption]
Rail Fence Cipher Program in C and C++[Encryption & Decryption]
Pigpen Cipher
Pigpen Cipher
some type of drawing with red ink on white paper that says, bottom tom left drawer of dad's desk
some type of drawing with red ink on white paper that says, bottom tom left drawer of dad's desk
the text and numbers are displayed in this screenshoter, which shows how to use them
the text and numbers are displayed in this screenshoter, which shows how to use them

Decrypting with an Example

Using the keyword 'KEYWORD' and the ciphertext 'LXFOPVEFRNHR', the decrypted message would be 'ATTACKATDAWN'.

As you can see, keyword ciphers are a simple yet effective way to encrypt and decrypt messages. They're not used much in modern cryptography due to their vulnerability to cryptanalysis, but they're a fascinating piece of history in the world of ciphers.

In the realm of data security, it's always fascinating to explore the past to understand the present. Keyword ciphers, while no longer used in modern cryptography, serve as a testament to the evolution of encryption methods. As we continue to navigate the digital landscape, it's crucial to stay informed about these historical methods to appreciate the complexity and sophistication of today's encryption techniques.