0% found this document useful (0 votes)
4 views23 pages

Module 1 Ch2

The document outlines the essential components of symmetric ciphers, which include plaintext, encryption algorithm, secret key, ciphertext, and decryption algorithm. It explains the security requirements for symmetric encryption and describes various cryptanalytic attacks based on the attacker's knowledge. Additionally, it covers specific ciphers such as the Caesar cipher, Playfair cipher, and Hill cipher, detailing their encryption processes and examples.
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)
4 views23 pages

Module 1 Ch2

The document outlines the essential components of symmetric ciphers, which include plaintext, encryption algorithm, secret key, ciphertext, and decryption algorithm. It explains the security requirements for symmetric encryption and describes various cryptanalytic attacks based on the attacker's knowledge. Additionally, it covers specific ciphers such as the Caesar cipher, Playfair cipher, and Hill cipher, detailing their encryption processes and examples.
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

1

MODULE 1 CHAPTER 2
[Link] are the essential ingredients of a symmetric cipher?
A symmetric cipher consists of five essential ingredients that together
form the foundation of the symmetric encryption process:
1. Plaintext: This is the original, readable message or data input to
the encryption process. It is the information that needs to be kept
confidential.
2. Encryption Algorithm: This algorithm takes the plaintext and
performs various substitutions and transformations to convert it
into an unreadable form. The exact nature of this transformation
depends on the secret key.
3. Secret Key: The secret key is a unique value used by the
encryption algorithm to control the transformation of plaintext
into ciphertext. Different keys result in different ciphertexts
even for the same plaintext. Keeping this key secret is crucial
for maintaining security.
4. Ciphertext: The output of the encryption algorithm, ciphertext
is the scrambled, unreadable version of the original plaintext.
Without the secret key, the ciphertext appears as random data
and cannot be understood.
5. Decryption Algorithm: The reverse of the encryption
algorithm, it uses the same secret key to convert the ciphertext
back into the original plaintext, enabling the intended receiver to
read the message.
For secure symmetric encryption, two major requirements should be
satisfied: the encryption algorithm must be strong enough to prevent
attackers from deducing either the plaintext or the key even if they
know the algorithm and have access to multiple ciphertexts; and the
secret key must be shared securely between the sender and receiver
and kept confidential at all times.
2

These ingredients form a symmetric encryption scheme where the


secret key is shared by both sender and recipient, enabling them to
communicate securely over an insecure channel. The security depends
primarily on the secrecy of the key rather than the secrecy of the
algorithm itself, which allows widespread practical implementations
in hardware and software.
In summary, the five essential ingredients of a symmetric cipher are
plaintext, encryption algorithm, secret key, ciphertext, and decryption
algorithm, which together provide a framework for secure message
encryption and decryption. These components ensure that confidential
information can be safely transmitted and only accessible to
authorized parties possessing the secret key.
3

[Link] neat diagram explain the concept of symmetric encryption


& cryptosystem.

Concept of Symmetric Encryption and Cryptosystem


Symmetric encryption, also known as conventional or single-key
encryption, is a fundamental cryptographic technique in which the
same secret key is used for both encryption and decryption of
messages. It was the sole encryption method before the advent of
public-key cryptography in the 1970s and continues to be the most
widely used type due to its efficiency and security when properly
implemented.
Essential Elements of Symmetric Encryption
A symmetric encryption scheme consists of five essential ingredients
as illustrated in the Simplified Model of Symmetric Encryption
(Figure 3.1 and Figure 3.2 from the textbook):
1. Plaintext (X): The original, meaningful message or data that the
sender wants to protect. This is the input to the encryption
algorithm.
2. Encryption Algorithm (E): This algorithm transforms the
plaintext into ciphertext by performing substitutions and
transpositions (transformations) based on the secret key. The
encryption algorithm is designed to be reversible.
3. Secret Key (K): A confidential piece of information shared only
between the sender and the receiver. The key is independent of
the plaintext and the algorithm. The transformations performed
by the encryption algorithm depend on this key, and two
different keys produce different ciphertexts for the same
plaintext.
4. Ciphertext (Y): The scrambled, unintelligible output of the
encryption process. Ciphertext is transmitted to the intended
receiver over the communication channel. Without the secret
4

key, the ciphertext appears as random data and conveys no


information about the original plaintext.
5. Decryption Algorithm (D): Essentially the reverse of the
encryption algorithm, it takes the ciphertext and the secret key
as inputs to reconstruct the original plaintext.

Mathematically, the encryption and decryption functions can be


expressed as:
Y=E(K,X)Y = E(K, X)Y=E(K,X) X=D(K,Y)X = D(K, Y)X=D(K,Y)
where:
 XXX is plaintext,
 YYY is ciphertext,
 KKK is the secret key,
 EEE and DDD are encryption and decryption algorithms
respectively.
5

Working of a Symmetric Cryptosystem

 The sender uses the secret key KKK and plaintext message
XXX as inputs to the encryption algorithm EEE to produce
ciphertext YYY.
 The ciphertext is transmitted to the receiver via a
communication channel.
 The receiver, who possesses the same secret key KKK, applies
the decryption algorithm DDD to YYY to obtain the original
plaintext XXX.
Figure 3.2 in the textbook depicts a model of symmetric
cryptosystem:
 A secure key distribution method ensures both sender and
recipient possess the same secret key.
 The ciphertext transmitted over the channel is only intelligible
to the parties sharing the secret key.
 A cryptanalyst with access to ciphertext (but without the secret
key) attempts to deduce the key or plaintext but is hindered by
the security of the encryption algorithm and key secrecy.
6

Security Considerations
1. Strength of Encryption Algorithm: The algorithm must be
strong enough to withstand cryptanalysis. Even if an attacker
knows the algorithm and has access to multiple ciphertexts,
including known plaintext–ciphertext pairs, they should not be
able to easily deduce the key or plaintext.
2. Key Security: The secret key must be obtained securely by both
sender and receiver and kept confidential at all times. If the key
is exposed, the encrypted communication is completely
compromised.
3. Algorithm Disclosure: The security of symmetric encryption
relies solely on key secrecy, not on keeping the encryption
algorithm secret. This openness enables widespread use and
implementation in hardware and software.
7

[Link] and briefly define types of cryptanalytic attacks based on


what is known to the attacker.

Types of Cryptanalytic Attacks Based on What is Known to the


Attacker
Cryptanalysis is the study of techniques for breaking cryptographic
systems and discovering either the key or the plaintext without
authorized access. The types of cryptanalytic attacks vary
according to the amount of information the attacker possesses
about the encrypted messages and the encryption system.
The main types of cryptanalytic attacks, as summarized in Table
3.1 of the textbook, are as follows:
1. Ciphertext-Only Attack (COA)
 Known to Attacker: Ciphertext only
 The attacker has access only to one or more ciphertext
messages, with no knowledge of the corresponding
plaintext or encryption key.
 The goal is to deduce the plaintext or the key by analyzing
the ciphertext patterns, often using frequency analysis or
statistical methods.
8

 This is the most challenging type of attack as it provides


the least information.
2. Known-Plaintext Attack (KPA)
 Known to Attacker: Ciphertext and one or more
corresponding plaintext-ciphertext pairs.
 The attacker knows some pairs of plaintext and the
corresponding ciphertext encrypted with the same key.
 Using this information, the attacker attempts to deduce the
secret key or decrypt other ciphertexts encrypted with the
same key.
 This attack is easier than ciphertext-only since the known
pairs help analyze how plaintext transforms under
encryption.
3. Chosen-Plaintext Attack (CPA)
 Known to Attacker: The attacker can choose arbitrary
plaintexts and obtain their ciphertexts encrypted under the
secret key.
 This is a powerful form of attack as the attacker can
carefully select plaintexts designed to reveal information
about the key.
 Differential cryptanalysis is an example of this attack.
4. Chosen-Ciphertext Attack (CCA)
 Known to Attacker: The attacker can choose arbitrary
ciphertexts and obtain their corresponding plaintexts
decrypted under the secret key.
 Less common in symmetric encryption but very relevant in
public-key cryptography.
 The attacker uses the decrypted plaintexts of the chosen
ciphertexts to analyze the key.
9

5. Adaptive Chosen-Plaintext and Chosen-Ciphertext Attacks


 These are advanced forms where the attacker adapts
choices based on previous results to optimize information
gain.

 The success of an attack greatly depends on how much


information is available to the attacker. The more that’s known,
the easier it becomes to break the cipher.
 Many modern encryption algorithms are designed to be secure
against known-plaintext and chosen-plaintext attacks, which are
the more powerful types of attacks.
 Ciphertext-only attacks are the hardest to perform successfully
because of limited information.
 Effective cryptanalysis often requires both a good understanding
of the cipher's structure and auxiliary information about the
plaintext.
10

[Link] define the Caesar cipher with example.


Caesar Cipher: Definition and Explanation
The Caesar cipher is one of the simplest and oldest known
encryption techniques and falls under the category of substitution
ciphers. It is named after Julius Caesar, who reportedly used it to
protect his military communications. The basic idea is to shift each
letter in the plaintext message by a fixed number of positions down
the alphabet.
 For example, if the shift (also called the key) is 3, then A is
replaced by D, B becomes E, C becomes F, and so forth.
 When the shift passes the end of the alphabet (Z), it wraps
around to the beginning (A).
More formally, the Caesar cipher operates as follows:
 Convert each letter of the plaintext into a number — for
example, A = 0, B = 1, ..., Z = 25.
 Encrypt each letter xx using the formula:
En(x)=(x+n) mod 26En(x)=(x+n)mod26
where nn is the shift value (the secret key).
 Decryption reverses the transformation by shifting letters
backwards:
Dn(x)=(x−n) mod 26Dn(x)=(x−n)mod26

Example of Caesar Cipher


Suppose the plaintext is HELLO and the shift chosen is 3.
 Encrypting each letter:
 H (7) becomes K (10)
 E (4) becomes H (7)
11

 L (11) becomes O (14)


 L (11) becomes O (14)
 O (14) becomes R (17)
 So, the ciphertext is KHOOR.
To decrypt, the recipient shifts each letter back by 3 to retrieve the
original plaintext HELLO.

Key Points about Caesar Cipher


 It is a simple substitution cipher where letters are shifted
cyclically.
 The number of possible keys = 25 (shifts from 1 to 25).
 It is easy to apply and understand, making it useful as an
educational tool.
 However, it is insecure by modern standards and is vulnerable to
brute-force and frequency analysis attacks.

[Link] define the monoalphabetic cipher with example.


12

[Link] the steps to achieve Playfair cipher with example.


13

Textbook
Playfair Cipher: Steps and Example
The Playfair cipher is a classical symmetric encryption technique
designed to encrypt pairs of letters (digraphs) instead of single letters,
making it significantly harder to cryptanalyze than simple substitution
ciphers like the Caesar cipher. It uses a 5x5 key square matrix
constructed from a keyword and the remaining alphabets (usually
combining I and J into one cell).
Steps to Achieve Playfair Cipher
1. Generate the Key Square (5x5 Grid)
 Select a keyword (e.g., MONARCHY).
 Remove repeated letters in the keyword.
 Arrange the letters of the keyword into the key square matrix
from left to right, top to bottom.
 Fill the remaining empty cells of the 5x5 matrix with the rest of
the alphabets in order, omitting the letter J (or combining it with
I).
For example, if the keyword is "MONARCHY", the 5x5 key matrix
might look like:
14

2. Prepare the Plaintext


 Convert the plaintext to uppercase and remove non-alphabetic
characters.
 Replace letter J with I since the matrix has only 25 letters.
 Divide the plaintext into pairs of two letters (digraphs).
 If a pair has identical letters (e.g., "LL"), insert a filler letter
(commonly X) between them.
 If the plaintext length is odd, append an extra filler letter (X) at
the end to make it even.
Example: The plaintext "HELLO" becomes "HE LX LO".
3. Encryption Rules for Each Digraph
For each pair of letters in the plaintext:
 Same Row: Replace each letter with the letter to its immediate
right in the row (wrapping around to the start if at the end).
 Same Column: Replace each letter with the letter immediately
below it in the column (wrapping to the top if at the bottom).
 Different Row and Column: Form a rectangle with the letters
as corners, then replace each letter with the letter in the same
row but in the other corner of the rectangle.
15

Encryption Example
Let's encrypt the digraphs for the plaintext "HELLO" with the key
matrix shown above.
 The pairs: HE, LX, LO
 Encrypting "HE":
o H is at row 2, column 2
o E is at row 3, column 0
o They form a rectangle; H gets replaced by the letter at row
2, column 0 = C
o E gets replaced by the letter at row 3, column 2 = G
 Similarly encrypt "LX" and "LO".

Decryption
 Decryption is done by applying the reverse of the encryption
rules on the ciphertext using the same key square.
 The same matrix is used, and ciphertext digraphs are mapped
back to the plaintext digraphs.

[Link] the Hill cipher with example.


The Hill cipher is a polygraphic substitution cipher based on linear
algebra, invented by Lester S. Hill in 1929. It encrypts blocks of
plaintext letters (usually in groups of size nn) by treating each block
as an nn-dimensional vector and multiplying it by an
invertible n×nn×n key matrix modulo 26 (where A=0, B=1, ..., Z=25).

Steps to Implement Hill Cipher


1. Select Key Matrix
16

 Choose an invertible n×nn×n matrix KK over modulo 26. The


matrix must have an inverse modulo 26 for decryption to be
possible.
 The key matrix acts as the secret key to both encryption and
decryption.
2. Prepare the Plaintext
 Convert the plaintext letters into numerical equivalents: A=0,
B=1, ..., Z=25.
 Divide the plaintext into blocks of size nn.
 If the message length is not divisible by nn, pad it with an extra
character (e.g., X).
3. Encryption
 Represent each plaintext block as an n×1n×1 column vector PP.
 Compute the ciphertext vector CC by
multiplying KK and PP modulo 26:
C=K×Pmod 26C=K×Pmod26
 Convert the numeric ciphertext back to letters.
4. Decryption
 The receiver computes the inverse of the key
matrix K−1K−1 modulo 26.
 Ciphertext blocks represented as vectors CC are multiplied
by K−1K−1 modulo 26 to retrieve plaintext vectors:
P=K−1×Cmod 26P=K−1×Cmod26
 Convert the resulting vectors back to letters to get the original
plaintext.
17
18

[Link] is the difference between a monoalphabetic cipher and


a polyalphabetic cipher? Discuss the polyalphabetic cipher
with example.

Polyalphabetic Cipher: Explanation and Example


A polyalphabetic cipher is a substitution cipher where the letters in
the plaintext are encrypted using multiple substitution alphabets. This
means the same letter in plaintext may be encrypted differently
depending on its position or the key used.
The Vigenère cipher is a well-known example of a polyalphabetic
cipher. It uses a keyword to determine the shift for each letter in
plaintext by applying a sequence of Caesar ciphers.

Steps for Vigenère Cipher (Example of Polyalphabetic Cipher)


 Choose a keyword (e.g., "KEY") — repeated to match the
length of the plaintext.
19

 Convert plaintext and keyword letters to numerical equivalents


(A=0 to Z=25).
Example

 Security Advantage
 Polyalphabetic ciphers complicate frequency analysis because letter
substitutions vary throughout the message, making patterns less apparent.

[Link] the two problems with the one-time pad with example.
Two Problems with the One-Time Pad
20

The one-time pad is a theoretically unbreakable encryption method


where a random key (pad) as long as the message is combined with
the plaintext using modular addition or XOR. Despite its perfect
secrecy, the one-time pad suffers from two significant practical
problems:

1. Key Generation Problem


 The one-time pad requires a truly random key of the exact same
length as the plaintext message.
 Generating such large amounts of high-quality randomness is
difficult and impractical for continuous or large-scale
communication.
 For example, if you want to encrypt a lengthy message or a
continuous data stream, you require an equally long key with
truly random characters, which is challenging to produce
reliably.

2. Key Distribution and Management Problem


 The secret key must be securely distributed and shared between
sender and receiver in advance.
 For every new message, a new key of the same length must be
shared and kept secret.
 Managing and securely distributing these large keys without
interception is a severe logistical challenge.
 If the key is reused or compromised, the security of the entire
system collapses.
Example to Illustrate Problem:
Suppose Alice wants to send a confidential 1000-character message to
Bob using a one-time pad:
21

 Alice must generate a 1000-character truly random key.


 Alice must then securely deliver this key to Bob without anyone
else intercepting it.
 If Eve an attacker intercepts or learns the key, she can decrypt
the entire message.
 Alice cannot reuse the same key for another message, else it
becomes vulnerable.
 For every subsequent 1000-character message, Alice and Bob
need a new random 1000-character key securely transmitted
beforehand.
Thus, although the one-time pad provides perfect security, it
is impractical for most real-world applications due to the difficulties
in generating, distributing, and securely managing keys of such
length.

[Link] is a transposition cipher? Discuss Rail-fence and Row-


column transposition.

Transposition Cipher: Definition


A transposition cipher is a type of encryption where the characters of
the plaintext are rearranged (permuted) according to some system or
key, without changing the actual characters themselves. The
ciphertext contains the same characters as the plaintext but in a
different order, making the message unintelligible without knowing
the key or permutation system.

Rail-fence Cipher (Rail Fence Transposition)


 The plaintext is written out diagonally over a number of "rails"
(rows) in a zigzag pattern.
22

 Then the letters are read off row-wise (horizontally) to create the
ciphertext.

Row-Column Transposition Cipher


 The plaintext is written into a rectangle (matrix) row by row.
 Then ciphertext is produced by reading the letters column by
column.
 The order of the columns can be permuted based on a key,
which is a sequence indicating the order in which columns are
read.
23

[Link]: Caesar, Playfair, Hill cipher, rail-fence and


Row-column transposition

You might also like