0% found this document useful (0 votes)
6 views9 pages

Network Security: Cryptography Overview

The document provides an overview of cryptography, detailing its goals, types, and benefits, emphasizing the importance of securing information. It covers symmetric and asymmetric key cryptography, various encryption methods, and modern cryptographic algorithms like IDEA and DES. The document also explains specific techniques such as the Caesar cipher, Vigenère cipher, and Playfair method, highlighting their functionalities and applications.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views9 pages

Network Security: Cryptography Overview

The document provides an overview of cryptography, detailing its goals, types, and benefits, emphasizing the importance of securing information. It covers symmetric and asymmetric key cryptography, various encryption methods, and modern cryptographic algorithms like IDEA and DES. The document also explains specific techniques such as the Caesar cipher, Vigenère cipher, and Playfair method, highlighting their functionalities and applications.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Network Security and Cryptography

(Practical – 2)

B.E (IT)- 5th Semester

Submitted To: Submitted By :


Ms. Amanpreet Kaur Shubham Gupta ,
UE238102
(IT Sec.2 , Group-3)

DEPARTMENT OF INFORMATION TECHNOLOGY


University Institute of Engineering & Technology
(Panjab University,Chandigarh)
CRYPTOGRAPHY-
Cryptography is the science and practice of securing information by
transforming it into a form that is unreadable to unauthorized users. It ensures
that only intended recipients can access and understand the data.
In Simple Words :
 Cryptography is about protecting information by using codes, ciphers,
and mathematical techniques.
Key Goals of Cryptography :
1. Confidentiality – keeping information secret from unauthorized users.
2. Integrity – ensuring data is not altered or tampered with.
3. Authentication – verifying the identity of users and sources.
4. Non-repudiation – preventing denial of actions (e.g., proving someone
sent a message).

Types of Cryptography:
 Symmetric key cryptography – same key is used for encryption and
decryption.
 Asymmetric key cryptography – uses a pair of keys (public and private).
 Hash functions – transform data into a fixed-length output, mainly for
verification.

Benefits of Cryptography :
 Data Confidentiality – Keeps sensitive information (like passwords, bank
details) hidden from unauthorized users.
 Data Integrity – Ensures that the information is not altered during
transmission or storage.
 Authentication – Verifies the identity of users, devices, or systems.
 Non-Repudiation – Prevents people from denying their actions (e.g.,
digital signatures prove that a person actually sent a message).
 Secure Communication – Protects messages exchanged over the
internet (emails, chats, transactions).
 Protection Against Cyber Attacks – Safeguards data from hacking,
phishing, and man-in-the-middle attacks.
 Trust in Digital Systems – Builds confidence in e-commerce, online
banking, and digital payments.

Symmetric Key Cryptography –


Symmetric key cryptography (also called secret-key cryptography) is a method
of encryption where the same key is used for both encryption (converting
plaintext into ciphertext) and decryption (converting ciphertext back into
plaintext).
Key Points:
 Single key: Both the sender and the receiver share a common secret key.
 Fast & efficient: Works well for encrypting large amounts of data.
 Key distribution problem: The main challenge is securely sharing the
secret key between parties without it being intercepted.
 Examples of symmetric algorithms:
o DES (Data Encryption Standard)
o AES (Advanced Encryption Standard)
o Blowfish
o RC4
Types of Symmetric Key Cryptography :
1. Caesar / Rot -13
2. Vigenere
3. Substitution Method
4. Playfair Encryption Method
5. Homophone
1. Caesar / ROT-13 :
 The Caesar cipher is one of the oldest and simplest symmetric key
cryptography methods.
 It is a substitution cipher where each letter in the plaintext is shifted by a
fixed number of positions in the alphabet.
 Example (Shift = 3):
 Plaintext: HELLO
 Ciphertext: KHOOR (each letter shifted 3 positions forward: H→K, E→H,
L→O, O→R).
(To decrypt, you just shift back by the same number)

2. Vigenère :
The Vigenère cipher is an improvement over the Caesar cipher.
Instead of using one fixed shift for the whole message, it uses a keyword to
decide different shifts for different letters.
That’s why it’s also called a polyalphabetic substitution cipher.

⚙️How it Works
1. Choose a keyword (e.g., "KEY").
2. Repeat the keyword until it matches the length of the plaintext.
o Plaintext: HELLO
o Keyword: KEYKE
3. Encrypt letter by letter:
o Convert letters to numbers (A=0, B=1, …, Z=25).
o Shift each plaintext letter by the value of the keyword letter.

3. Substitution Method / Atbash Method –


A substitution cipher is one of the oldest and simplest methods of encryption.
In it, each letter (or group of letters) in the plaintext is replaced with another
letter (or symbol) according to a fixed rule.

Types of Substitution
1. Monoalphabetic Substitution
o Each plaintext letter always maps to the same ciphertext letter.
o Example: Caesar cipher (shift by fixed number).
o Plaintext: HELLO → Ciphertext: KHOOR (shift by 3).
2. Polyalphabetic Substitution
o A single plaintext letter can map to different ciphertext letters
depending on its position or key.
o Example: Vigenère cipher.
o Plaintext: HELLO, Key: KEY → Ciphertext: RIJVS.
3. Homophonic Substitution
o One plaintext letter may be replaced by several possible ciphertext
symbols, chosen randomly, to make frequency analysis harder.
4. Polygraphic Substitution
o Groups of letters (digraphs, trigraphs) are encrypted together.
o Example: Playfair cipher (works on pairs of letters).
o Example: Hill cipher (uses matrices on blocks of letters).

4. Playfair Encryption Method :


It is a polygraphic substitution cipher, meaning it encrypts pairs of letters
(digraphs) instead of single letters. This makes it stronger than simple
substitution ciphers like Caesar.

Steps of Playfair Cipher


1. Choose a keyword
 Example keyword: "MONARCHY"
2. Construct a 5×5 matrix
 Fill it with the keyword (without repeating letters), then the rest of the
alphabet.
 Usually, I and J are combined (treated as the same letter).
3 Prepare the plaintext
 Plaintext: "HELLO"
 Break into pairs: HE LL OX
o If a pair has the same letter (like LL), insert a filler (X).
o If odd number of letters, add a filler (X).

5. Homophone Method of Encryption :


The Homophonic method of encryption is a type of substitution cipher
where:
 Each plaintext letter can be replaced by multiple possible ciphertext
symbols.
 The exact symbol used is chosen at random (or by rule).
This was invented to defeat frequency analysis (the main weakness of simple
substitution).

How It Works
1. Assign multiple ciphertext symbols to common letters
o Example:
 E → could be {12, 45, 88}
 T → could be {21, 56}
 X → maybe just {99} (since it’s rare)
2. Encrypt plaintext by replacing each letter with one of its assigned
symbols
o Example plaintext: "MEET"
o Suppose assignments:
 M → {33}
 E → {12, 45, 88}
 T → {21, 56}
Possible ciphertext: "33 45 88 21" (but could vary depending on which symbols
you pick).
3. Decrypt: Receiver maps numbers back to possible letters.

Modern Methods of Cryptography :


Modern symmetric algorithms are much stronger because they work on bits
and blocks, not just letters, and are designed to resist all known attacks.
Examples of Modern Methods :
 IDEA
 DES (ECB)
 DES (CBC)
 Triple DES (ECB)
 Triple DES (CBC)

IDEA Method of Cryptography :


The IDEA cipher is a symmetric-key block cipher designed by James Massey and
Xuejia Lai in 1991.
It was meant to replace the older DES cipher.

Main Features
 Block size: 64 bits (plaintext divided into 64-bit blocks).
 Key size: 128-bit secret key.
 Rounds: 8 identical rounds + 1 final half-round.
 Operations used:
1. XOR (bitwise addition mod 2)
2. Addition modulo 2¹⁶ (normal integer addition with wraparound at
65,536)
3. Multiplication modulo 2¹⁶ + 1 (with special handling when values
are 0)
These operations are mixed together to create confusion + diffusion (Shannon’s
principles for secure ciphers).

DES (ECB) type of cryptography :


DES (Data Encryption Standard) is a symmetric block cipher that encrypts 64-bit
blocks of plaintext using a 56-bit secret key.
When used in ECB (Electronic Codebook) mode, each block of plaintext is
encrypted independently into ciphertext.
This makes it simple but weak, because identical plaintext blocks always
produce identical ciphertext blocks, revealing patterns.
 Easy to implement
 but Not secure for large data (patterns leak)

DES(CBC) Type of Cryptography :


DES (Data Encryption Standard) is a symmetric block cipher that encrypts 64-bit
blocks with a 56-bit secret key.
In CBC (Cipher Block Chaining) mode, each plaintext block is XORed with the
previous ciphertext block before encryption.
An Initialization Vector (IV) is used for the first block to ensure uniqueness.
This removes patterns (more secure than ECB) but requires proper IV
management.

Triple DES (ECB) :


Triple DES (3DES) is a symmetric block cipher that improves DES by applying the
DES algorithm three times on each 64-bit block with either two or three
different keys (key sizes: 112 or 168 bits).
In ECB (Electronic Codebook) mode, each block is encrypted independently
using 3DES, which makes it simple but still vulnerable to pattern leakage if data
has repeating blocks.
 Stronger than single DES
 but Still weaker and slower than modern ciphers like AES

Triple DES (CBC) Method of Cryptography :


Triple DES (3DES) is a symmetric block cipher that applies the DES algorithm
three times on each 64-bit block using two or three keys (112/168-bit key
length).
In CBC (Cipher Block Chaining) mode, each plaintext block is XORed with the
previous ciphertext block before encryption, with an Initialization Vector (IV)
for the first block.
This chaining removes repeating patterns, making it much more secure than
ECB mode.
 Stronger than DES and 3DES-ECB
 but slower and less secure than modern AES.

You might also like