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

chapter 3-2

The document provides an overview of cryptography, detailing concepts such as plaintext, ciphertext, encryption, and decryption. It discusses various encryption techniques, including the Caesar cipher, Rail Fence technique, Vernam cipher, and Simple Columnar technique, along with their advantages and disadvantages. Additionally, it explains the principles of cryptanalysis and cryptology as the study of secure communication and breaking cryptographic systems.

Uploaded by

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

chapter 3-2

The document provides an overview of cryptography, detailing concepts such as plaintext, ciphertext, encryption, and decryption. It discusses various encryption techniques, including the Caesar cipher, Rail Fence technique, Vernam cipher, and Simple Columnar technique, along with their advantages and disadvantages. Additionally, it explains the principles of cryptanalysis and cryptology as the study of secure communication and breaking cryptographic systems.

Uploaded by

Tanisha Waichal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Network and Information Security

Cryptography
3.1 Introduction

Plaintext is unencrypted data in readable form.


Plain Text: This is the original, readable message or data
before encryption. It is in a human-readable or machine-
readable format and has not been altered for security.
E.g. Plain Text: HELLO

Cipher Text: This is the encrypted version of the plain text,


transformed using an encryption algorithm. It is unreadable
text.
E.G. Cipher Text (using a simple Caesar cipher with a shift
of 3): KHOOR
Continue…
Cryptography:- The practice and study of secure
communication techniques that prevent third parties
from accessing information.

Cryptography is a technique of securing


communication by converting plain text into cipher text.

Cryptanalysis:- The science of analyzing and breaking


cryptographic systems to decode encrypted messages.
Continue…

• Cryptology- The scientific study of both cryptography


(creating secure systems) and cryptanalysis (breaking
secure systems). It deals with mathematical and
computational techniques for securing data.
• Encryption- The process of converting plain text into
cipher text using an algorithm and a key, making it
unreadable to unauthorized users.
• Decryption- The process of converting cipher text
back into plain text using a decryption key. This
reverses encryption, restoring the original message.
Substitution Techniques

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.

For example, if the shift is 3, then the letter A would be


replaced by the letter D, B would become E, and so on. The
alphabet is wrapped around so that after Z, it starts back at
A.
Here is an example of how to use the Caesar cipher to
encrypt the message “HELLO” with a shift of 3:
1. Write down the plaintext message: HELLO
2. Choose a shift value. In this case, we will use a shift of 3.
3. Replace each letter in the plaintext message with the letter
that is three positions to the right in the alphabet.
H becomes K (shift 3 from H)
E becomes H (shift 3 from E)
L becomes O (shift 3 from L)
L becomes O (shift 3 from L)
O becomes R (shift 3 from O)
Caesar cipher

• To decrypt the message, you simply need to shift each letter


back by the same number of positions. In this case, you
would shift each letter in “KHOOR” back by 3 positions to
get the original message, “HELLO”.
Advantages

• Easy to implement and use thus, making suitable for


beginners to learn about encryption.
• Can be physically implemented, which can be useful in
certain situations.
• Requires only a small set of pre-shared information.
• Can be modified easily to create a more secure
variant, such as by using a multiple shift values or
keywords.
Disadvantages

• It is not secure against modern decryption methods.


• The small number of possible keys means that an attacker
can easily try all possible keys until the correct one is
found, making it vulnerable to a brute force attack.
• It is not suitable for long text encryption as it would be
easy to crack.
• It is not suitable for secure communication as it is easily
broken.
• Does not provide confidentiality, integrity, and authenticity
in a message.
Algorithm for Caesar Cipher
• Input
• Choose a shift value between 1 and 25.
• Write down the alphabet in order from A to Z.
• Create a new alphabet by shifting each letter of the
original alphabet by the shift value. For example, if the
shift value is 3, the new alphabet would be:
• ABCDEFGHIJKLMNOPQRSTUVWXYZ
DEFGHIJKLMNOPQRSTUVWXYZABC
• Replace each letter of the message with the
corresponding letter from the new alphabet.
• To decrypt the message, shift each letter back by the
Ra i l F e n c e T e c h n i q u e s

• In the rail fence cipher, the plain-text is written downwards


and diagonally.
• When we reach the bottom rail, we traverse upwards
moving diagonally, after reaching the top rail, the direction
is changed again. Thus the alphabets of the message are
written in a zig-zag manner.
• After each alphabet has been written, the individual rows
are combined to obtain the cipher-text.
Rail Fence Technique Example

Plain text: come home tomorrow


Key/Depth: 2

Cipher text: cmhmtmrooeoeoorw


Rail Fence Technique Example
Rail Fence Transposition Cipher

Example: The plain text is "Hello Krishna"


Now, we will write this plain text in the diagonal form:

Now, following the second step we get our cipher text.

Cipher Text = “hlorsnelkiha"


Vernam Cipher

• Vernam Cipher is a method of encrypting alphabetic


text. It is one of the Substitution techniques for
converting plain text into cipher text. In this
mechanism, we assign a number to each character of
the Plain-Text, like (a = 0, b = 1, c = 2, … z = 25).

Method to take key: In the Vernam cipher algorithm, we


take a key to encrypt the plain text whose length should
be equal to the length of the plain text.
Vernam Cipher Encryption Algorithm

--Assign a number to each character of the plain text and the


key according to alphabetical order.

--Bitwise XOR both the number (Corresponding plain-text


character number and Key character number).

--Subtract the number from 26 if the resulting number is


greater than or equal to 26, if it isn’t then leave it.
Example

• Plain Text: O A K
• Key: S O N

O ==> 14 = 0 1 1 1 0
S ==> 18 = 1 0 0 1 0

Bitwise XOR Result: 1 1 1 0 0 = 28


28 - 26 = 2 ==> C
CIPHER-TEXT: C
Continue…
• Similarly, do the same for the other corresponding
characters,

Plain Text: O A K
NO: 14 00 10
KEY: S O N
NO: 18 14 13
Example 2

• Plain-Text: RAMSWARUPK
• Key: RANCHOBABA

• Now according to our encryption algorithm, we assign a


number to each character of our plain text and key.

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 character NO: 0 0 1 16 17 14 16 20 14 10


Since there are no numbers that are greater than or equal to
26 we do not have to subtract 26 from any of them.
New Cipher-Text is after getting the corresponding character
from the 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 (_).

• Step 4: The message is read in the order as specified by the keyword.


Simple Columnar Technique

• The plain text characters are placed horizontally and the


cipher text is created with vertical format as : holewdlo lr
Vigenere Cipher (Polyalphabetic Cipher)
Vigenere Cipher

You might also like