# Aristocrat Cipher

The Aristocrat Cipher is a type of monoalphabetic substitution cipher in which plaintext is replaced with ciphertext and encoded into assorted letters, numbers, and symbols based on a keyword. The formatting of these ciphers generally includes a title, letter frequency, keyword indicators, and the encoder's nom de plume. The predecessor to these ciphers stems from the Caesar Cipher around 100. The Aristocrat Cipher also used a transposition of letters to encrypt a message.

## History

Coined in 1929 by a group of friends, a part of the American Cryptogram Association (ACA), the Aristocrat Cipher's name was a play on words intended to show the organization as high class and intellectual. The Aristocrat Cipher, often referred to as the 'Aristocrat of Puzzles,' represented a significant shift in the paradigm of cryptography, particularly within the American Cryptogram Association, which popularized this challenging form of monoalphabetic substitution cipher.
Substitution Ciphers and the Aristocrat Cipher are still used in many ways today including storage encryption, password encryption, cyber security, etc. The most common of these is data encryption, where using the Encryption Algorithms you convert plaintext to ciphertext, allowing your data to be stored without easy exfiltration.

### History

Monoalphabetic substitution ciphers trace their origins to the Italian humanist Leon Battista Alberti, born on February 14, 1404, in Genoa, Italy. Alberti, the illegitimate son of Lorenzo Alberti, was raised in Venice, where he began his education in Latin and mathematics at a young age. Despite earning a degree in law from the University of Bologna, Alberti’s interests soon shifted towards the arts and sciences. In 1432, he took up a position in the Papal Chancery, and during a visit to Florence in 1434, he developed a keen interest in cryptography, influenced by his association with Leonardo Dati, who introduced him to the field of cryptology.
In 1467, Alberti conceived of a disk which held 24 equal segments called cells that contained letters, and a movable inner circle which contained ciphertext symbols. This became known as the Alberti Disk and was the very first polyalphabetic cipher in history. Alberti's disk also helped develop the monoalphabetic ciphers, by compartmentalizing plaintext and ciphertext.

## Types of Aristocrat Ciphers

The Aristocrat Ciphers have four main types: K1, K2, K3, and K4.
K1 Cipher: This type uses a keyed plaintext alphabet for encryption. The plaintext alphabet is rearranged according to a keyword, and each letter is substituted according to this rearranged alphabet.
K2 Cipher: In this type, the ciphertext is generated using a keyed ciphertext alphabet. The ciphertext alphabet is rearranged according to a keyword, which then replaces the plaintext letters.
K3 Cipher: This variation uses both a keyed plaintext and a keyed ciphertext alphabet, but the same keyword is used for both.
K4 Cipher: Similar to the K3 Cipher, but different keywords are used for the plaintext and ciphertext alphabets.
These types allow cryptographers to diversify their encryption techniques and help prevent decryption of the message. According to guidelines established by the American Cryptogram Association, Aristocrat Ciphers—one of the most popular cipher types—require that no plaintext letter be substituted with itself in the ciphertext, maintaining the cipher's complexity and security.

### Homophones

A homophone is a type of cipher in which each plaintext character translates to some ciphertext letters or symbols. Ciphers that use this method are called homophonic ciphers, some of these ciphers are the Hill Cipher and Playfair Cipher. Homophonic ciphers can be decrypted to multiple messages. Ciphers that include multiple messages are called High-Order Homophonic. High-order ciphers outline multiple keys for encryption and decryption, this means that depending on your key you'd receive a different message.

## Encryption
### K2 Aristocrat Cipher Encryption

The following example demonstrates the process of encrypting a message using the K2 Aristocrat Cipher, employing the keyword "jumping" and the phrase "The quick brown fox jumps over the lazy dog." This particular phrase is often used in cryptographic examples because it is a pangram. This makes it ideal for demonstrating encryption and decryption processes, as it ensures that all letters of the alphabet are included in the example.
In a K2 Aristocrat Cipher, the ciphertext alphabet is constructed by placing the keyword at the beginning of the alphabet, followed by the remaining letters in their standard order, omitting those already used in the keyword. This method ensures that each letter in the plaintext is substituted by a different letter in the ciphertext. If any letters overlap at the end of the alphabet, such as Z-Z or X-X, they are repositioned to maintain the cipher's security and adhere to guidelines established by the American Cryptogram Association .
Here's how the encryption would proceed:
Converted Plaintext to Ciphertext :
| 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 |
| Ciphertext | V W X Y Z J U M P I N G A B C D E F H K L O Q R S T |
Converted Message :
| Plaintext | The quick brown fox jumped over the lazy dog |
| Ciphertext | Kmz elpxn wfcqb jcr iladzy cozf kmz gvts ycu |

## Decryption
### Security

The cypher can be broken using cryptanalysis methods, especially when using a keyword. If keywords were excluded, it would make the puzzle more secure, but there still are ways around the encryption. The most known way is frequency analysis, this uses the distribution of letters throughout texts to infer what the ciphertext would be. The method creates a chain-reaction when a letter is decrypted, this means that after decrypting a word, the letters of that word can be used to decrypt other words.
Depending on the type of cipher, a brute force attack method can be used, which attempts to use all possible keys for the encryption. David Kahn states in The Codebreakers, "If a cryptanalyst tried one of these (403,291,461,126,605,635,584,000,000 possible keys) every second, he or she would need 1.2788 x 10$^9$ years to run through them all."

### Frequency Analysis

There are many ways to decode these ciphers, the most common being frequency analysis. The process of frequency analysis can be complicated, and it uses educated analysis of the frequency of letters in texts to declassify the key. By calculating the frequency distribution for the K2 Aristocrat and comparing it to the English Distribution, the translation can be estimated.
Frequency Distribution :
| 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 |
| 1 | 1 | 4 | 1 | 1 | 1 | 1 | X | 1 | 1 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | X | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 4 |
This can be compared to the English Language Allocation Map. The most likely correlation would be toward Z or C for the letter E, since they have the highest frequencies.