0% found this document useful (0 votes)
25 views

Caesar Cipher

This document describes the Caesar cipher, one of the earliest known substitution ciphers. It involves shifting each letter in a plaintext message by a set number of positions (the key) in the alphabet to produce the ciphertext. For example, with a key of 3, A would become D, B would become E, etc. The document provides examples of encrypting and decrypting messages using the Caesar cipher. It also describes how the encryption and decryption processes can be represented mathematically using modular arithmetic.

Uploaded by

Ali Saddique
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Caesar Cipher

This document describes the Caesar cipher, one of the earliest known substitution ciphers. It involves shifting each letter in a plaintext message by a set number of positions (the key) in the alphabet to produce the ciphertext. For example, with a key of 3, A would become D, B would become E, etc. The document provides examples of encrypting and decrypting messages using the Caesar cipher. It also describes how the encryption and decryption processes can be represented mathematically using modular arithmetic.

Uploaded by

Ali Saddique
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Caesar Cipher

 Presented By:
1. Ali (2020-SE-33)
2. Hashar Ahmed (2020-SE-12)
Terms:
 Plaintext
 Is a message to be communicated.

 Ciphertext
 A disguised version of a plaintext.

 Encryption
 The process of turning Plaintext into Ciphertext.

 Decryption
 The process of turning Ciphertext into Plaintext.
Caesar Cipher
 One of the earliest known examples of substitution cipher.

 Said to have been used by Julius Caesar to communicate with his army (secretly).

 Each character of a plaintext message is replaced by a character n position down in the alphabet.

 Belongs to Substitution Cipher.


Caesar Cipher
Example:
 The first row denotes the plaintext
 Second row denotes the ciphertext
 The ciphertext is obtained by "shifting" the original letter by the N position to the right.
 In this example, it is shifted by 3 to the right.
 A becomes D
 B becomes E
 X becomes A, and so on...

A B C D E … … X Y Z
D E F G H … … A B C
Caesar Cipher
 Suppose the following plaintext is to be encrypted:
ATTACK AT DAWN
 By shifting each letter by 3, to the right. Then the resulting ciphertext would be:

DWWDFN DW GDZQ

A B C D E … … X Y Z
D E F G H … … A B C
Caesar Cipher
 One could shift other than 3 letters apart.
 The offset (Number of shifts) is called the "Key"
Decryption Process:
 Given that the key is known, just shift back N letter to the left.
Example:
 Ciphertext: WJYZWS YT GFXJ
 Key used: 5

 Plaintext: RETURN TO BASE


Caesar Cipher
Math Behind Encryption:
 This can be represented using modular arithmetic.
 Assume that : A = 0, B = 1, C = 2, ..., Y = 24, Z = 25.
 Encryption process can be represented as:
 Such that: e(x) = (x + k) (mod 26)
 X → the plaintext.
 K → the number of shifts (offset).
 26 → There are 26 letters in the alphabet (English alphabet).
Caesar Cipher
Math Behind Decryption:
 Can be represented using modular arithmetic.
 Assume that : A = 0, B = 1, C = 2, ..., Y = 24, Z = 25.
 The decryption process can be represented as:
 Such that: e(x) = (x - k) (mod 26).
 X → the plaintext.
 k → the key (number of shifts or offset).
 26 → There are 26 letters in the alphabet (English alphabet).
Example
Can Define Transformation as:
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
F G H I J K L M N O P Q R S T U V W X Y Z A B C D E

Mathematically Give Each Letter a number :


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
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

 Then have Caesar cipher as:


 c = E(p) = (p + k) mod (26)  12%26  12 = M
 p = D(c) = (c – k) mod (26)  7%26  7 = H
 Example: HOWDY (7,14,22,3,24) encrypted using key k (i.e a shift of 5) is MTBID
Thank You

You might also like