Nexus Encryption Logo
HomeCiphersAbout UsContact

Caesar Cipher: Decoder and Encoder


Transformation

Rotations

Transformed Text

Caesar Cipher: A Classical Encryption Technique

What is Caesar Cipher?

The Caesar Cipher is a type of classical encryption technique which uses either substitution or transposition only. Substitution ciphers can be further divided into monoalphabetic and polyalphabetic ciphers.

History

The Caesar Cipher is the earliest known substitution cipher, used by Julius Caesar. It replaces each letter in the plaintext with the letter that is a fixed number of positions down the alphabet. For example, with a key (K) of 10, 'a' becomes 'k'.

Example

Given the secret message P: "hello", and the key K: "10":

Plaintext: hello
Key: 10
Encrypted Message (Ciphertext): rovvy

The formula used is:

C = E(P) = (P + K) mod 26 or C = E(P) = (P - K) mod 26

To understand modular operations, consider this example: If 6 hours pass, what time is it? A common mistake would be to answer 13, but on a 12-hour clock, it would be 1: 7 + 6 mod 12 = 1. Similarly, the Caesar cipher uses modulus 26 with the English alphabet.

Why Caesar Cipher is so Weak?

The key size is too small (only 25 possible keys), making it easily breakable by brute force.

How can we improve Caesar Cipher's security?

One way to improve security is to use a monoalphabetic cipher that uses an arbitrary substitution. This method involves shuffling the letters in the plaintext by mapping them to a different, random ciphertext letter.

For instance, you can set up a secret phrase or word as the secret key. Let's use "MARKET" as our secret key. The remaining alphabet letters follow the last character of the key (excluding those already used).

Example of Arbitrary Substitution

Secret key: MARKET
Remaining letters:
M A R K E T B C D F G H I J L N O P Q S U V W X Y Z

The secret key "MARKET" is followed by the rest of the alphabet, excluding letters already used in the key.

Arbitrary Ceaser Cipher


Transformation

Rotations

Transformed Text