List of Ciphers

Note that the intercepted message you are tasked with decrypting does not seem to be encrypted with any of the ciphers introduced here. Station HYDRA suspects the use of superencipherment. For the first layer of defense, you are on your own.

1 JN-25

1.1 Description

JN-25 was a two-stage encryption system that combined a large codebook with additive encryption. The cipher consisted of approximately 45,000 five-digit code groups (each representing a word or phrase), which were further encrypted using five-digit additive numbers to mask the original codebook values. This created a formidable security layer that required cryptanalysts to strip away the additive before recovering the underlying code meanings.

1.2 Prerequisites

To use JN-25 effectively, both the sender and receiver required:

1.3 Encrypt a Message

  1. Prepare the Plaintext Message

    Select or compose the message to be sent. Break it down into logical units that can be represented by codebook entries.

    Example: A Japanese naval commander wants to send ATTACK AT DAWN to a fleet.
  2. Look Up Code Groups

    For each word or phrase in the message, consult the JN-25 codebook and record the corresponding five-digit code group.

    Continuing our example, the operator consults the codebook:
    • ATTACK corresponds to code group: 97851
    • AT DAWN corresponds to code group: 45612
  3. Determine the Indicator

    Select a starting point in the additive table.

    The operator chooses index 34 as the starting position.
  4. Encipher the Message with Additives

    Beginning from the selected starting point in the additive table, take sequential five-digit additive numbers. Add each additive to its corresponding code group using modulo 100,00 addition to create the cipher groups.

    From position 34, the operator retrieves two sequential additives:
    • Additive 1: 12345
    • Additive 2: 67890
    Now he adds each additive to its corresponding code word.
    • ATTACK (code group 97851) becomes (97851 + 12345) mod 100,000 = 09196
    • AT DAWN (code group 45612) becomes (45612 + 67890) mod 100,000 = 02402
  5. Build the Complete Message

    Assemble the final message as:

    • The indicator
    • The enciphered message text
    The operator assembles the final message as 34 09196 02402

1.4 Decrypt a Message

  1. Extract Message Components

    Separate the indicator and enciphered message body.

    The operator receives 34 09196 02402 and correctly identifies 34 as the indicator and 09196 02402 as the enciphered message body.
  2. Locate Additive Sequences

    Using the recovered indicator, identify the correct position in the additive table and prepare to use the sequential additive numbers from that point.

    From position 34, the operator retrieves the same two sequential additives:
    • Additive 1: 12345
    • Additive 2: 67890
  3. Remove Additives from Message

    For each five-digit cipher group in the message body, subtract the corresponding sequential additive number using non-carrying subtraction. This yields the original five-digit code group.

    Now he adds each additive to its corresponding code word.
    • 09196 becomes (09196 - 12345 + 100,000) mod 100,000 = 97851
    • 02402 becomes (02402 - 67890 + 100,000) mod 100,000 = 02402
  4. Consult the Codebook

    Look up each recovered five-digit code group in the JN-25 codebook to find its meaning.

    The operator consults the codebook:
    • 97851 corresponds to code group: ATTACK
    • 45612 corresponds to code group: AT DAWN

2 Monoalphabetic Substitution Cipher

2.1 Quick Description

A monoalphabetic substitution cipher (also called a simple substitution cipher) is one of the most fundamental encryption methods. It works by replacing each letter of the plaintext alphabet with a corresponding letter in a cipher alphabet, using a fixed, one-to-one mapping. For example, if the letter "A" is mapped to "M", then every instance of "A" in the plaintext will become "M" in the ciphertext. The security of this cipher relies entirely on keeping the substitution key (the mapping) secret[4].

2.2 Prerequisites

To use a monoalphabetic substitution cipher, both parties require:

2.3 Steps to Encrypt a Message with Monoalphabetic Substitution

  1. Create or Obtain the Substitution Key

    Develop a shuffled alphabet that serves as the cipher alphabet. This can be created by randomly rearranging the 26 letters of the alphabet.

    Example Key:

    • 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
    • Cipher: M U A L V O Z K R N J X Q D F S H P E B C T I W Y G
  2. Write Out the Plaintext Message

    Prepare the message to be encrypted, typically in uppercase for clarity.

    Example plaintext: "ATTACK AT DAWN"

  3. Replace Each Letter

    For each letter in the plaintext, find it in the plaintext alphabet and replace it with the corresponding letter in the cipher alphabet.

    PlaintextATTACKATDAWN
    CipherMCCMAXMCLMID
  4. Maintain Spacing and Punctuation (Optional)

    Decide whether to preserve word breaks and punctuation or remove them for increased security. Both approaches are valid depending on the security requirements.

  5. Transmit the Ciphertext

    Send only the ciphertext. The substitution key must be communicated through a separate secure channel.

  6. Complete Example

    Using the example key above:

    • Plaintext: "ATTACK AT DAWN"
    • Ciphertext: "MCCMAX MC LMID"

2.4 Steps to Decrypt a Message with Monoalphabetic Substitution

  1. Obtain the Substitution Key

    Acquire the correct cipher alphabet key through a secure channel.

    Example key:

    • Cipher alphabet: M U A L V O Z K R N J X Q D F S H P E B C T I W Y G
    • Plaintext alphabet: 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
  2. Reverse the Key Mapping

    Create the reverse mapping by identifying each ciphertext letter's position in the cipher alphabet and finding the corresponding plaintext letter.

  3. Write Out the Ciphertext

    Prepare the encrypted message.

    Example ciphertext: "KOZZY DYOXN"

  4. Replace Each Letter

    For each letter in the ciphertext, find it in the cipher alphabet and replace it with the corresponding plaintext letter.

    CiphertextKOZZYDYOXN
    PlaintextHELLOWORLD
  5. Complete the Decryption

    Reassemble the decrypted message with original spacing and punctuation.

    Result: "HELLO WORLD"

2.5 Attack Vectors Against Monoalphabetic Substitution

2.5.1 Frequency Analysis

The most powerful attack against monoalphabetic substitution ciphers exploits the predictable frequency distribution of letters in English and other languages. In English:

An attacker analyzes the frequency distribution of letters in the ciphertext and compares it to known frequency distributions for the suspected plaintext language. High-frequency ciphertext letters likely correspond to common plaintext letters[4].

2.5.2 Pattern and Word Structure Analysis

Attackers exploit patterns such as:

These patterns significantly reduce the search space for the correct substitution key.

2.5.3 Known Plaintext Attack

If an attacker knows or can guess a portion of the plaintext, they can immediately determine the substitution mappings for those letters. This partial key knowledge can then be extended through frequency analysis and pattern matching to recover the complete key.

2.5.4 Chosen Plaintext Attack

If an attacker can convince the cipher operator to encrypt a message containing known plaintext (such as a repeated word or phrase), they can directly observe the corresponding ciphertext mappings and recover portions of the key.

2.5.5 Brute Force Attack

While there are 26! (approximately 4.0 × 10²⁶) possible monoalphabetic substitution keys, this number is still computationally feasible for modern computers. A brute force approach tries all possible keys and checks which one produces intelligible plaintext. This would take only seconds on contemporary hardware.

2.5.6 Dictionary-Based Attack

The attacker uses a dictionary of common words in the suspected plaintext language. For each identified word pattern in the ciphertext, the attacker checks which dictionary words match that pattern, reducing the key search space dramatically.

2.5.7 Contextual and Linguistic Analysis

An experienced cryptanalyst uses knowledge of:

This human-driven analysis can significantly accelerate key recovery compared to purely algorithmic approaches.

2.5.8 Statistical Testing and Scoring

Modern attacks use statistical methods to score candidate keys based on how well the decrypted text matches expected English (or other language) characteristics, including n-gram frequencies (digraph, trigraph frequencies), entropy measures, and chi-squared testing[4].

3. Comparative Summary

PropertyJN-25Monoalphabetic Substitution
Cipher TypeCode + AdditiveSubstitution
Key Size45,000 code groups + additives26! ≈ 4.0 × 10²⁶
ComplexityVery High (two-stage)Low (single stage)
Historical PeriodWWII (1939-1945)Classical era and earlier
Primary AttackDepth analysis, stereotypesFrequency analysis
Mathematical StructureAdditive-based encodingPermutation-based
VulnerabilityOperator error, reuse of additivesFixed mappings, letter frequency

4. Conclusion

JN-25 and monoalphabetic substitution ciphers represent two distinct points in cryptographic history and complexity. While the monoalphabetic substitution cipher is elementary and highly vulnerable to frequency analysis, it serves as a fundamental building block for understanding encryption concepts. JN-25, by contrast, represents a sophisticated attempt to layer multiple security mechanisms through code-based encryption combined with additive masking.

However, both systems ultimately fell to determined cryptanalytic effort. JN-25's vulnerabilities stemmed not from mathematical weakness but from operational issues: human error in selecting additive starting positions, reuse of additives creating depths, and stereotyped message patterns. The monoalphabetic substitution cipher's fundamental weakness—the fixed relationship between plaintext and ciphertext letters—cannot be overcome by any operational discipline.

Modern cryptography has learned from these historical lessons, moving toward systems with strong mathematical foundations (such as RSA and AES) combined with rigorous operational security practices.

References

  1. [1] NSA. (2021, August 19). JN-25. Retrieved from https://www.nsa.gov/History/Cryptologic-History/Historical-Events/Article-View/Article/2740680/jn-25/
  2. [2] NSA. (2021, August 19). JN-25. Retrieved from https://www.nsa.gov/History/Cryptologic-History/Historical-Events/Article-View/Article/2740680/jn-25/
  3. [3] Christensen, C. (2022, April). JN25: The Imperial Japanese Navy's Primary World War II Naval Cipher. Virtual academic presentation.
  4. [4] Crypto Corner. (2012, December 31). Monoalphabetic substitution ciphers. Retrieved from https://crypto.interactive-maths.com/monoalphabetic-substitution-ciphers.html