0% found this document useful (0 votes)
11 views6 pages

Cipher Chapter8

The document explains various encryption methods including the Caesar Cipher, Vigenere Cipher, Transposition Cipher, and Vernam Cipher, detailing the steps for both encryption and decryption processes. Each cipher is illustrated with examples, showing how to shift letters, use keys, and apply binary operations. The document serves as a guide for understanding these cryptographic techniques.

Uploaded by

inaff25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views6 pages

Cipher Chapter8

The document explains various encryption methods including the Caesar Cipher, Vigenere Cipher, Transposition Cipher, and Vernam Cipher, detailing the steps for both encryption and decryption processes. Each cipher is illustrated with examples, showing how to shift letters, use keys, and apply binary operations. The document serves as a guide for understanding these cryptographic techniques.

Uploaded by

inaff25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Substitution Cipher

Caesar Cipher (Monoalphabetic)

Example: Encrypt the word A T T A C K with Caesar Cipher shift 5

Step 1. Determine the key in this example the key is 5

Step 2. Shift the alphabets with A = 0

Plain Text A T T A C K
Cipher Text F Y Y F H P

Vignere Cipher (Polyalphabetic)

Example: Encrypt the word Z O O M with the key K E Y using Vignere Cipher

Step 1. Determine the Positions of the Plain Text

Step 2. Choose a key (In this example the key is K E Y). Since ZOOM is 4 letters the key will
repeat so ( K E Y K )

Step 3. Determine the Positions of Key

Step 4. Determine the shifted positions by adding the Positions of the Plain Text letters Plus the
Positions of the Key

Step 5. For Values resulting greater than 26(Mod 26) Subtract it with the Value

Step 6. The resulting value is the Position of the Cipher Text

Plain Text Z O O M
Position 25 14 14 12
Key K E Y K
Key Position 10 4 24 10
Shifted Position 35 18 38 22
Mod 26 (35-26) 9 18 (38-26) 12 22
Cipher Text J S M W
To decrypt

Step 1. Reverse all the process starting from Plain Text Positions

Step 2. All will be the same except for the Shifted Positions. The current Position will be
subtracted to the key Position

Step 3. For Mod26 Values. Add 26 to those who have negative values

Step. Turn it back to the original Text

Plain Text J S M W
Position 9 18 12 22
Key K E Y K
Key Position 10 4 24 10
Shifted Position -1 (9 -10) 14 -12(12-24) 12
Mod 26 (-1 +26) 25 14 14 (-12+26) 22
Cipher Text Z 0 0 M

Transposition Cipher
Example: Reverse the Plain Text H E L L O

Plain Text H E L L O
Cipher Text O L L E H

Vernam Cipher
Example: Encrypt the word D O G with the key X K Y using Vernam Cipher

Step 1: Convert the Message "DOG" to Decimal and Binary

First, we convert each letter in "DOG" to its ASCII Decimal value, then to Binary.

Letter ASCII Decimal Binary

D 68 01000100

O 79 01001111

G 71 01000111

DOG → 01000100 01001111 01000111

Step 2: Generate a Random Key (One-Time Pad)


Our random key is X K Y

Random Key Letter ASCII Decimal Binary

X 88 01011000

K 75 01001011

Y 89 01011001

Step 3: Encrypt the Message (XOR Operation)


Encrypt 'D' (68) with 'X' (88)

D 0 1 0 0 0 1 0 0
X 0 1 0 1 1 0 0 0
XOR ⊕ 0 0 0 1 1 1 0 0

01000100 (D = 68) ⊕ 01011000 (X = 88)

= 00011100 (Ciphertext)

Encrypt 'O' (79) with 'K' (75)

O 0 1 0 0 1 1 1 1
K 0 1 0 0 1 0 1 1
XOR ⊕ 0 0 0 0 0 1 0 0

01001111 (O = 79) ⊕ 01001011 (K = 75)

= 00000100 (Ciphertext)

Encrypt 'G' (71) with 'Y' (89)

G 0 1 0 0 0 1 1 1
Y 0 1 0 1 1 0 0 1
XOR ⊕ 0 0 0 1 1 1 1 0

01000111 (G = 71) ⊕ 01011001 (Y = 89)

= 00011110 (Ciphertext)

The Cipher Text is 00011100 00000100 00011110 in Binary

You can convert 00011100 to decimal by


Binary 0 0 0 1 1 1 0 0
Convert 𝟐𝟕 𝟐𝟔 𝟐𝟓 𝟐𝟒 𝟐𝟑 𝟐𝟐 𝟐𝟏 𝟐𝟎
Decimal 0 0 0 16 8 4 0 0
= 28

You can convert 00000100 to decimal by

Binary 0 0 0 0 0 1 0 0
Convert 𝟐𝟕 𝟐 𝟔
𝟐 𝟓 𝟐 𝟒
𝟐 𝟑
𝟐 𝟐
𝟐 𝟏
𝟐𝟎
Decimal 0 0 0 0 0 4 0 0
=4

You can convert 00011110 to decimal by

Binary 0 0 0 1 1 1 1 0
Convert 𝟐𝟕 𝟐 𝟔
𝟐 𝟓 𝟐 𝟒
𝟐 𝟑
𝟐 𝟐
𝟐 𝟏
𝟐𝟎
Decimal 0 0 0 16 8 4 2 0
= 30

The encrypted Text is 28 , 40 , 30

To Decrypt

Step 1. Transform 28 40 and 30 into binary

Step 2. Use XOR in Cipher Text with the KEY

28 40 30 ----- 00011100 00000100 00011110

28 0 0 0 1 1 1 0 0
X 0 1 0 1 1 0 0 0
XOR ⊕ 0 1 0 0 0 1 0 0
= 01000100 is 68 in decimal and is letter D

40 0 0 0 0 0 1 0 0
K 0 1 0 0 1 0 1 1
XOR ⊕ 0 1 0 0 1 1 1 1
=01001111 is 79 in decimal and letter O

30 0 0 0 1 1 1 1 0
Y 0 1 0 1 1 0 0 1
XOR ⊕ 0 1 0 0 0 1 1 1
=01000111 is 71 in decimal and letter G

You might also like