chapter 3-2
chapter 3-2
Cryptography
3.1 Introduction
1. Caesar cipher
Text : ABCDEFGHIJKLMNOPQRSTUVWXYZ
Shift: 23 Cipher: XYZABCDEFGHIJKLMNOPQRSTUVW
Text : ATTACKATONCE
Shift: 4 Cipher: EXXEGOEXSRGI
Substitution Techniques
1. Caesar cipher
The Caesar Cipher is one of the simplest and oldest
methods of encrypting messages, named after Julius
Caesar. This technique involves shifting the letters of the
alphabet by a fixed number of places.
• Plain Text: O A K
• Key: S O N
O ==> 14 = 0 1 1 1 0
S ==> 18 = 1 0 0 1 0
Plain Text: O A K
NO: 14 00 10
KEY: S O N
NO: 18 14 13
Example 2
• Plain-Text: RAMSWARUPK
• Key: RANCHOBABA
PT: R A M S W A R U P K
NO: 17 0 12 18 22 0 17 20 15 10
KEY: R A N C H O B A B A
NO: 17 0 13 2 7 14 1 0 1 0
• Now Bitwise XOR the number of Plain-Text and Key and
after doing the XOR operation and subtraction operation (if
required), we will get the corresponding Cipher-Text
character number.
CIPHER-TEXT: A A B Q R O Q U O K
Simple Columnar Technique
• In this technique, first, we write the message or plaintext in rows. After that, we
read the message column by column. In this technique, we use a keyword to
determine the no of rows.
• Step 1: First we write the message in the form of rows and columns, and read the
message column by column.
• Step 2: Given a keyword, which we will use to fix the number of rows.
• Step 3: If any space is spared, it is filled with null or left blank or in by (_).