×
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

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?

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

The shift cipher, also known as the Caesar cipher, is a classical substitution cipher that forms a foundational concept in cryptography. This cipher operates by shifting each letter in the plaintext by a predetermined number of positions down the alphabet. A critical aspect of this method involves the treatment of letters at the end of the alphabet, which is resolved using modular arithmetic.

Historical Context and Mechanism

The shift cipher derives its name from Julius Caesar, who reportedly used it to protect his military correspondence. In the standard configuration, the cipher replaces each letter in the plaintext with the letter a fixed number of places forward in the alphabet. The process can be mathematically described as follows:

Let each letter of the alphabet be assigned a numeric value, typically with A=0, B=1, …, Z=25 for a 26-letter English alphabet. For a shift of k positions, each plaintext letter P is encrypted to ciphertext letter C according to the function:

    \[ C = (P + k) \mod 26 \]

Here, modular arithmetic ensures that the operation 'wraps around' the end of the alphabet. For example, with a shift of 3, the letter 'Y' (which is 24) is mapped to:

    \[ C = (24 + 3) \mod 26 = 27 \mod 26 = 1 \]

Therefore, 'Y' becomes 'B'.

Modular Arithmetic and Its Role

Modular arithmetic is the mathematical system underpinning the shift cipher's operation. In modular arithmetic, numbers "wrap around" upon reaching a certain value — the modulus. In the context of the shift cipher, the modulus is the size of the alphabet, which is 26 for the modern English alphabet.

This property is essential for handling letters near the end of the alphabet. Without modular arithmetic, shifting a letter like 'Z' by any positive number would produce a value outside the range of valid alphabetic characters. Modular arithmetic brings the result back within the allowable range, enabling seamless cycling through the alphabet.

For instance, consider a shift of 5 applied to the letter 'W' (which is 22):

    \[ C = (22 + 5) \mod 26 = 27 \mod 26 = 1 \]

Hence, 'W' becomes 'B'.

Detailed Example

Suppose we encrypt the word "HELLO" with a shift of 7:

– H (7) → (7 + 7) mod 26 = 14 → O
– E (4) → (4 + 7) mod 26 = 11 → L
– L (11) → (11 + 7) mod 26 = 18 → S
– L (11) → (11 + 7) mod 26 = 18 → S
– O (14) → (14 + 7) mod 26 = 21 → V

So, "HELLO" becomes "OLSSV". Notice how the cipher handles the letter 'O' (14) by moving forward seven positions and wrapping around if necessary.

Reverse Operation (Decryption)

Decryption in the shift cipher applies the inverse operation. If k is the shift used in encryption, the decryption function is:

    \[ P = (C - k) \mod 26 \]

As modular arithmetic permits negative results to be brought back into the 0–25 range, this allows correct decryption even when the result of C - k is negative. For example, suppose we wish to decrypt 'B' (1) that was encrypted with a shift of 3:

    \[ P = (1 - 3) \mod 26 = -2 \mod 26 = 24 \]

Therefore, 'B' decrypts to 'Y'.

Application to the Full Alphabet

It is important to recognize that the shift cipher is not limited to a subset of the alphabet. All letters, including those at both the beginning and end, are subject to the shift and the modular arithmetic operation. This means that any letter, when shifted beyond 'Z', will circle back to the start, and vice versa when decrypting. This circular nature is a direct consequence of modular arithmetic and is fundamental to the design of the cipher.

Didactic Value of Modular Arithmetic in the Shift Cipher

The use of modular arithmetic in the shift cipher serves as a practical and intuitive introduction to modular concepts in mathematics and cryptography. It demonstrates how a simple mathematical operation can create a repeating, cyclical structure, which is not only effective for classical encryption but also foundational for many modern cryptographic algorithms.

The didactic value is significant in several ways:

1. Understanding Circular Structures: The shift cipher provides a concrete example of how modular arithmetic creates a cycle, making abstract mathematical concepts accessible.

2. Foundation for Advanced Ciphers: Many modern ciphers, such as the Vigenère cipher and even some components of contemporary block ciphers, employ modular arithmetic. Grasping its role in the shift cipher prepares learners for more complex cryptosystems.

3. Error Detection and Correction: Modular arithmetic's "wrap-around" behavior is used in error detection (checksums, cyclic redundancy checks) and correction codes, tying classical ciphers to broader information theory.

4. Algorithmic Implementation: The shift cipher demonstrates how mathematical operations can be implemented algorithmically, an important skill in cryptographic programming.

5. Historical Insight: Studying modular arithmetic within historical ciphers highlights the interplay between mathematics and cryptography, illustrating how simple techniques laid the groundwork for modern secure communication.

Generalization to Other Alphabets and Symbols

While the standard shift cipher is described for the 26-letter English alphabet, the principles apply to any finite set of symbols. For example, with numerals (0–9), a shift of 4 on '8' would be:

    \[ C = (8 + 4) \mod 10 = 12 \mod 10 = 2 \]

Thus, '8' becomes '2'. This demonstrates the adaptability of modular arithmetic to various character sets, which is critical for ciphers applied to languages with different alphabets or symbolic systems.

Practical Security and Limitations

Historically, the shift cipher was used for its simplicity and ease of manual computation. However, it is susceptible to brute-force attacks due to the limited number of possible shifts (25 for the English alphabet, excluding the trivial shift of 0). Frequency analysis also easily breaks the cipher, as the structure of the underlying language remains evident in the ciphertext.

Despite its cryptographic weakness, the shift cipher remains a valuable teaching tool for understanding substitution ciphers and modular arithmetic.

In the shift cipher, letters at the end of the alphabet are indeed replaced with letters from the beginning according to the rules of modular arithmetic. This mathematical approach ensures that the alphabet is treated as a cycle, maintaining consistent, predictable behavior for all input letters, regardless of their position. This characteristic is a direct result of modular arithmetic and is essential for the correct functioning of the cipher. The principles demonstrated in the shift cipher form the basis of numerous other cryptographic systems, making it an instructive starting point for studies in cryptography, mathematics, and computer science.

Other recent questions and answers regarding EITC/IS/CCF Classical Cryptography Fundamentals:

  • Was public-key cryptography introduced for use in encryption?
  • Is the set of all possible keys of a particular cryptographic protocol referred to as the keyspace in cryptography?
  • What should a block cipher include according to Shannon?
  • Was the DES protocol introduced to improve the security of AES cryptosystems?
  • Does the security of block ciphers depend on combining confusion and diffusion operations many times?
  • Do the encryption and decryption functions need to be kept secret for the cryptographic protocol to remain secure?
  • Can cryptanalysis be used to communicate securely over an insecure communication channel?
  • Do Internet, GSM, and wireless networks belong to the insecure communication channels?
  • Is an exhaustive key search effective against substitution ciphers?
  • Does the AES MixColumn sublayer include a nonlinear transformation that can be represented by a 4×4 matrix multiplication?

View more questions and answers in EITC/IS/CCF Classical Cryptography Fundamentals

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: Caesar Cipher, Cryptography, Cybersecurity, Modular Arithmetic, Shift Cipher, Substitution Cipher
Home » Cybersecurity » EITC/IS/CCF Classical Cryptography Fundamentals » History of cryptography » 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?

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 by

    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.