Caesar Cipher

Encrypt and decrypt text using the classic Caesar Cipher substitution method

Shift Amount:
Character Sets:
Numbers
Special Characters

Caesar Cipher: A Classic Encryption Tool

The Caesar Cipher, also known as the shift cipher or Caesar's code, is one of the earliest and most fundamental encryption techniques in cryptography. Named after Julius Caesar, who used it for secret communication, the Caesar Cipher operates by shifting each letter in the plaintext a certain number of positions along the alphabet. This simple yet effective Caesar Cipher technique has been a cornerstone of basic cryptography for over two millennia.

How Caesar Cipher Works

The Caesar Cipher encryption method employs a simple substitution technique where each letter in the plaintext is replaced by a letter that is a fixed number of positions down the alphabet. This shift value is the key to both encryption and decryption in the Caesar Cipher system.

For example, in a Caesar Cipher with a shift of 3:

  • A → D (shifted 3 positions)
  • B → E (shifted 3 positions)
  • C → F (shifted 3 positions)
  • ...
  • Z → C (wraps around to the beginning)

Caesar Cipher Encryption Process

The Caesar Cipher encryption process follows a mathematical formula:

E(x)=(x+n)mod26E(x) = (x + n) \bmod 26

In the Caesar Cipher formula:

  • x represents the position of the plaintext letter (A=0, B=1, ...)
  • n is the Caesar Cipher shift value
  • 26 is the size of the alphabet

Caesar Cipher Decryption Process

To decrypt a Caesar Cipher message, we reverse the encryption process:

D(x)=(xn)mod26D(x) = (x - n) \bmod 26

The Caesar Cipher decryption process shifts the letters back by the same number of positions used in encryption, effectively reversing the original transformation.

Caesar Cipher Character Sets

Our modern implementation of the Caesar Cipher supports multiple character sets:

  • Letters (A-Z, a-z) - Always enabled in Caesar Cipher
  • Numbers (0-9) - Optional extension to classic Caesar Cipher
  • Special Characters (,.!?@#$%&*()-+=:;<>[]) - Enhanced Caesar Cipher support

Caesar Cipher Examples

Example 1: Basic Caesar Cipher (Shift=3)

Original Text: HELLO

Caesar Cipher Result: KHOOR

Example 2: Extended Caesar Cipher with Numbers (Shift=1)

Original Text: HELLO123

Caesar Cipher Result: IFMMP234