×
1 Choose EITC/EITCA Certificates
2 Learn and take online exams
3 Get your IT skills certified

Confirm your IT skills and competencies under the European IT Certification framework from anywhere in the world fully online.

EITCA Academy

Digital skills attestation standard by the European IT Certification Institute aiming to support Digital Society development

LOG IN TO YOUR ACCOUNT

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR PASSWORD?

AAH, WAIT, I REMEMBER NOW!

CREATE AN ACCOUNT

ALREADY HAVE AN ACCOUNT?
EUROPEAN INFORMATION TECHNOLOGIES CERTIFICATION ACADEMY - ATTESTING YOUR PROFESSIONAL DIGITAL SKILLS
  • SIGN UP
  • LOGIN
  • INFO

EITCA Academy

EITCA Academy

The European Information Technologies Certification Institute - EITCI ASBL

Certification Provider

EITCI Institute ASBL

Brussels, European Union

Governing European IT Certification (EITC) framework in support of the IT professionalism and Digital Society

  • CERTIFICATES
    • EITCA ACADEMIES
      • EITCA ACADEMIES CATALOGUE<
      • EITCA/CG COMPUTER GRAPHICS
      • EITCA/IS INFORMATION SECURITY
      • EITCA/BI BUSINESS INFORMATION
      • EITCA/KC KEY COMPETENCIES
      • EITCA/EG E-GOVERNMENT
      • EITCA/WD WEB DEVELOPMENT
      • EITCA/AI ARTIFICIAL INTELLIGENCE
    • EITC CERTIFICATES
      • EITC CERTIFICATES CATALOGUE<
      • COMPUTER GRAPHICS CERTIFICATES
      • WEB DESIGN CERTIFICATES
      • 3D DESIGN CERTIFICATES
      • OFFICE IT CERTIFICATES
      • BITCOIN BLOCKCHAIN CERTIFICATE
      • WORDPRESS CERTIFICATE
      • CLOUD PLATFORM CERTIFICATENEW
    • EITC CERTIFICATES
      • INTERNET CERTIFICATES
      • CRYPTOGRAPHY CERTIFICATES
      • BUSINESS IT CERTIFICATES
      • TELEWORK CERTIFICATES
      • PROGRAMMING CERTIFICATES
      • DIGITAL PORTRAIT CERTIFICATE
      • WEB DEVELOPMENT CERTIFICATES
      • DEEP LEARNING CERTIFICATESNEW
    • CERTIFICATES FOR
      • EU PUBLIC ADMINISTRATION
      • TEACHERS AND EDUCATORS
      • IT SECURITY PROFESSIONALS
      • GRAPHICS DESIGNERS & ARTISTS
      • BUSINESSMEN AND MANAGERS
      • BLOCKCHAIN DEVELOPERS
      • WEB DEVELOPERS
      • CLOUD AI EXPERTSNEW
  • FEATURED
  • SUBSIDY
  • HOW IT WORKS
  •   IT ID
  • ABOUT
  • CONTACT
  • MY ORDER
    Your current order is empty.
EITCIINSTITUTE
CERTIFIED

Is an exhaustive key search effective against substitution ciphers?

by Theresa Sittel / Saturday, 17 May 2025 / Published in Cybersecurity, EITC/IS/CCF Classical Cryptography Fundamentals, History of cryptography, Modular arithmetic and historical ciphers

An exhaustive key search, also known as brute-force attack, involves systematically trying every possible key in the keyspace of a cipher until the correct key is found. The effectiveness of such an approach depends greatly on the size of the keyspace, which is determined by the number of possible keys, and the structure of the cipher being attacked.

Substitution ciphers are a class of classical cryptographic algorithms where each element of the plaintext (most commonly a letter) is systematically replaced with another fixed element of the ciphertext. The most familiar types are simple substitution ciphers (where each letter in the alphabet is mapped to another letter), and monoalphabetic substitution ciphers, as well as more complex polyalphabetic substitution ciphers, such as the Vigenère cipher.

To evaluate the effectiveness of an exhaustive key search against substitution ciphers, it is necessary to analyze both the theoretical and practical aspects, including the size of the keyspace, the nature of the keys, and the characteristics of the ciphertext produced.

Keyspace of Substitution Ciphers

A simple substitution cipher using the 26-letter English alphabet has a keyspace size equal to the number of possible permutations of the alphabet. Mathematically, this is 26 factorial (26!), which equals 403,291,461,126,605,635,584,000, or roughly 4 x 10^26 possible keys. For comparison, the Caesar cipher, a specific type of substitution cipher, has a much smaller keyspace of only 25 keys (since each letter can be shifted by any value between 1 and 25).

A key aspect of substitution ciphers is that the key is not a random bit string but a permutation of the alphabet, which affects how keys are generated and tested in an exhaustive search.

Exhaustive Key Search on Simple Substitution Ciphers

The principle of an exhaustive key search dictates that for each possible key, the attacker decrypts the ciphertext and checks if the resulting plaintext is meaningful. For substitution ciphers, especially those with large keyspaces such as monoalphabetic substitution, this theoretically presents a computationally difficult problem, as there are a staggering number of possible permutations to test.

However, the practical effectiveness of exhaustive search on substitution ciphers is limited by several factors:

1. Key Verification

Unlike modern ciphers where a key either produces the correct plaintext or not, with substitution ciphers, the attacker must decide whether the output is valid English (or the expected plaintext language). There is no indicator or checksum in classical ciphers, so the attacker must manually or automatically verify the output. Given the redundancy and predictability of natural languages, this is typically easy for humans to recognize, but hard to automate, especially given the number of keys.

2. Redundancy in Language

Because natural languages like English have significant redundancy and structure, decrypted outputs that do not correspond to readable text can be quickly discarded. However, statistically, the likelihood of randomly permuting the alphabet and producing meaningful text is astronomically low, making the exhaustive search inefficient.

3. Feasibility

Though the keyspace is enormous, modern computers could, in theory, attempt millions or even billions of keys per second. Nonetheless, the 26! keyspace is vast enough that even with immense computational resources, an exhaustive search would take an impractical amount of time.

Historical and Practical Attacks

Despite the theoretical security provided by the size of the keyspace, substitution ciphers are not considered secure, even against attackers without the resources for an exhaustive key search. The main reason is that these ciphers are vulnerable to analytical attacks, especially frequency analysis.

Frequency Analysis

Each letter in the plaintext is always replaced by the same letter in the ciphertext, so the statistical properties of the plaintext are preserved. For example, in English text, the letter 'E' is the most common. By analyzing the frequency of letters in the ciphertext, an attacker can deduce which ciphertext symbols correspond to which plaintext letters.

This method is far more efficient than exhaustive key search. It requires only a moderate amount of ciphertext to be effective, and it can recover the key or the plaintext with little computational effort compared to a brute-force approach.

Example

Suppose an attacker intercepts a ciphertext encrypted using a monoalphabetic substitution cipher. A frequency count is performed, revealing that the symbol 'Q' occurs most frequently. If the attacker knows the language is English, it is likely that 'Q' corresponds to 'E'. By repeating this process for other frequently occurring letters (such as 'T', 'A', 'O'), the attacker can reconstruct the substitution key, or at least part of it, without trying all 26! permutations.

Key Recovery vs. Plaintext Recovery

Exhaustive key search seeks to recover the key so that any message encrypted with the same key can be decrypted. Frequency analysis, and similar analytical attacks, usually provide enough of the key to recover the plaintext, even if the full key is not recovered immediately. In practice, this is sufficient to break the security of the cipher.

Modular Arithmetic and Classical Ciphers

Some substitution ciphers, such as the affine cipher and Caesar cipher, use modular arithmetic in their transformations.

– Caesar Cipher: Each plaintext letter is shifted by a fixed number of positions in the alphabet. Mathematically, for plaintext letter x, ciphertext is computed as (x + k) \mod 26, where k is the shift (key).
– Affine Cipher: Each letter is encrypted as (ax + b) \mod 26, where a and b are keys, and a and 26 must be coprime.

For these ciphers, the keyspace is much smaller (25 for Caesar, 312 for affine), making exhaustive key search not only feasible but trivial. For example, an attacker can try all 25 possible Caesar shifts in seconds. Thus, brute-force attacks are highly effective against these ciphers.

Polyalphabetic Substitution Ciphers

More complex ciphers, like the Vigenère cipher, use a repeating key to change the substitution for each letter, making frequency analysis less effective. However, the keyspace is determined by the length and possible values of the key.

If the key is of length n, and each character can be any letter (26 options), the keyspace is 26^n. For short keys, this is still susceptible to exhaustive search. For example, a 5-letter key yields 11,881,376 possible keys (26^5), which is well within the reach of modern computers. However, a longer key increases the keyspace exponentially, but practical Vigenère cipher use often involved short keys, making them vulnerable to brute-force and analytical attacks.

In the case of the Vigenère cipher, if the key length is known, the cipher can be broken into an equivalent of several Caesar ciphers, which can each be attacked separately. Methods such as the Kasiski examination and Friedman test can help determine the key length, after which frequency analysis is applied to each subset.

Practical Security Assessment

The practical insecurity of substitution ciphers is not due to their keyspace size alone, but rather the structural weaknesses that allow analytical attacks. Exhaustive key search is theoretically effective, as it guarantees that the key will be found eventually, but in practice, it is not the attack method of choice due to inefficiency and the availability of more effective techniques.

For classical ciphers with small keyspaces (like Caesar and affine ciphers), exhaustive key search is trivially effective. For monoalphabetic substitution ciphers, the keyspace is large enough to prevent exhaustive search with even the most powerful modern computers, but these ciphers are still insecure due to frequency analysis.

Didactic Value

Studying the (in)effectiveness of exhaustive key search against substitution ciphers offers valuable lessons in cryptography:

– Keyspace Size Matters, But Isn't Everything: A large keyspace can render brute-force attacks infeasible, but does not guarantee security if the cipher leaks structural information about the plaintext.
– Importance of Statistical Properties: Classical ciphers often fail because they preserve the statistical characteristics of the plaintext, allowing analytical attacks.
– Role of Modular Arithmetic: Understanding how arithmetic operations define the transformations in ciphers like Caesar and affine ciphers helps illuminate why their keyspaces are so small and why they are so easily brute-forced.
– Evolution of Cryptanalysis: The historical progression from brute-force to analytical attacks demonstrates the advancement of the field and the need for ciphers that do not leak information about the plaintext or the key.

Example Calculation

Suppose an attacker wishes to brute-force a monoalphabetic substitution cipher. If a supercomputer could try 1 billion (10^9) keys per second, it would take:

    \[ \frac{4 \times 10^{26}}{10^9 \text{ keys/sec}} = 4 \times 10^{17} \text{ seconds} \]

    \[ = \frac{4 \times 10^{17}}{60 \times 60 \times 24 \times 365} \approx 1.27 \times 10^{10} \text{ years} \]

This is orders of magnitude longer than the age of the universe, rendering brute-force attacks practically infeasible.

Modern Perspective

In contemporary cryptography, the lessons from substitution ciphers are clear. Key size alone is not a sufficient measure of security; the structure of the cipher and its resistance to analytical and statistical attacks are equally, if not more, important. Modern ciphers, such as AES, are designed to resist both exhaustive key search (by featuring astronomically large keyspaces) and all known analytical attacks.

Classical ciphers, including substitution ciphers, are thus valuable teaching tools for understanding the interplay between keyspace, cipher structure, and the methods of cryptanalysis.

Other recent questions and answers regarding Modular arithmetic and historical ciphers:

  • In a shift cipher, are the letters at the end of the alphabet replaced with letters from the beginning of the alphabet according to modular arithmetic?
  • What does the value K stand for in a shift cipher?
  • Is mod K arithmetic used in a shift cipher, where K is the value of the key and denotes the number of shifted letters?
  • How many equivalence classes are there in modulo 3 arithmetic?
  • Will a shift cipher with a key equal to 4 replace the letter d with the letter h in ciphertext?
  • Do identical plaintext map to identical cipher text of a letter frequency analysis attact against a substitution cipher
  • Are 7 and 12 equivalent in mode 5 operation
  • Are mod 2 addition and subtraction different operations?
  • How can an affine cipher be injective?
  • Can substitution ciphers be broken by a brute force attack?

View more questions and answers in Modular arithmetic and historical ciphers

More questions and answers:

  • Field: Cybersecurity
  • Programme: EITC/IS/CCF Classical Cryptography Fundamentals (go to the certification programme)
  • Lesson: History of cryptography (go to related lesson)
  • Topic: Modular arithmetic and historical ciphers (go to related topic)
Tagged under: Brute-force Attack, Classical Encryption, Cryptanalysis, Cybersecurity, Frequency Analysis, Substitution Ciphers
Home » Cybersecurity » EITC/IS/CCF Classical Cryptography Fundamentals » History of cryptography » Modular arithmetic and historical ciphers » » Is an exhaustive key search effective against substitution ciphers?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (105)
  • EITCA Certification (9)

What are you looking for?

  • Introduction
  • How it works?
  • EITCA Academies
  • EITCI DSJC Subsidy
  • Full EITC catalogue
  • Your order
  • Featured
  •   IT ID
  • EITCA reviews (Medium publ.)
  • About
  • Contact

EITCA Academy is a part of the European IT Certification framework

The European IT Certification framework has been established in 2008 as a Europe based and vendor independent standard in widely accessible online certification of digital skills and competencies in many areas of professional digital specializations. The EITC framework is governed by the European IT Certification Institute (EITCI), a non-profit certification authority supporting information society growth and bridging the digital skills gap in the EU.
Eligibility for EITCA Academy 90% EITCI DSJC Subsidy support
90% of EITCA Academy fees subsidized in enrolment

    EITCA Academy Secretary Office

    European IT Certification Institute ASBL
    Brussels, Belgium, European Union

    EITC / EITCA Certification Framework Operator
    Governing European IT Certification Standard
    Access contact form or call +32 25887351

    Follow EITCI on X
    Visit EITCA Academy on Facebook
    Engage with EITCA Academy on LinkedIn
    Check out EITCI and EITCA videos on YouTube

    Funded by the European Union

    Funded by the European Regional Development Fund (ERDF) and the European Social Fund (ESF) in series of projects since 2007, currently governed by the European IT Certification Institute (EITCI) since 2008

    Information Security Policy | DSRRM and GDPR Policy | Data Protection Policy | Record of Processing Activities | HSE Policy | Anti-Corruption Policy | Modern Slavery Policy

    Automatically translate to your language

    Terms and Conditions | Privacy Policy
    EITCA Academy
    • EITCA Academy on social media
    EITCA Academy


    © 2008-2026  European IT Certification Institute
    Brussels, Belgium, European Union

    TOP
    CHAT WITH SUPPORT
    Do you have any questions?
    We will reply here and by email. Your conversation is tracked with a support token.