# Toy cipher — does it have a name?

When I was perhaps nine years, I borrowed a book from the library on various maths and CS topics. It outlined various simple ciphers, including one that I used a lot, just for fun. I can't remember the name of the book, or the name of the cipher, so I hope you can help me with the latter one.

It is a monoalphabetic substitution cipher with words as key. The key, an arbitrary word in the alphabet, is concatenated with the alphabet itself, and then duplicate letters are removed (keeping only the first occurrence). The resulting word is the cipher alphabet.

For instance, using the modern English alphabet and the key "STACKEXCHANGE", the cipher alphabet would become "STACKEXHNG" (key, later duplicates removed) concatenated with "BDFIJLMOPQRUVWYZ" (alphabet without letters from key):

plain  : ABCDEFGHIJ KLMNOPQRSTUVWXYZ
cipher : STACKEXHNG BDFIJLMOPQRUVWYZ


Of course, this cipher is insecure past the "highest" letter in the key (Y=Y, Z=Z), but it's still interesting as a practical explanation of substitution ciphers (perhaps even more, due to its weaknesses).

To repeat my question: does this scheme have a commonly known name? Or is known to be attributed to a person?

-

## migrated from security.stackexchange.comJun 16 '12 at 18:18

This question came from our site for Information security professionals.

This question seems better in crypto stack exchange. –  Terry Chia Jun 16 '12 at 14:37

## 2 Answers

This is a simple substitution cipher, specifically a mixed/deranged alphabet cipher. See wikipedia's description:

Substitution of single letters separately—simple substitution—can be demonstrated by writing out the alphabet in some order to represent the substitution. This is termed a substitution alphabet. The cipher alphabet may be shifted or reversed (creating the Caesar and Atbash ciphers, respectively) or scrambled in a more complex fashion, in which case it is called a mixed alphabet or deranged alphabet. Traditionally, mixed alphabets may be created by first writing out a keyword, removing repeated letters in it, then writing all the remaining letters in the alphabet in the usual order. Using this system, the keyword "zebras" gives us the following alphabets:

 Plaintext alphabet:    ABCDEFGHIJKLMNOPQRSTUVWXYZ
Ciphertext alphabet:    ZEBRASCDFGHIJKLMNOPQTUVWXY

-
I guess I should have checked Wikipedia first. I'll take its word for it. Thanks :) –  Rhymoid Jun 16 '12 at 22:59

It's sometimes called a keyword cipher. As dr jimbob notes, it's a particular type of monoalphabetic substitution cipher.

Ps. See also this recent question about breaking such ciphers.

-