Information Security System
Information Security System
Block Cipher
A Block Cipher encrypts data in fixed-size blocks usually 64 or 128 bits at a
time. The encryption algorithm processes each block of data separately using
the cryptographic key to transform the plaintext into the ciphertext. Block
ciphers function on complex mathematical computation and permutation to
ensure that the data encrypted is safe. The choice of block size does not directly
affect the strength of the encryption scheme.
The strength of the cipher depends upon the key length. However, any size of the
block is acceptable. The following aspects can be kept in mind while selecting
the size of a block:
• Avoid very small block sizes,
• Do not have very large block sizes
• In Multiples of 8-bit.
Examples: AES, DES and Blowfish.
Stream Cipher
A stream cipher encrypts data one bit or byte at a time. It uses a keystream
generator to produce a stream of pseudo-random bits, which are then combined
with the plaintext bits (usually via XOR operation) to produce ciphertext.
It can be categorized into the synchronous, self-synchronizing and one-time pad
types.
Advantages of CBC
• CBC works well for input greater than b bits.
• CBC is a good authentication mechanism.
• Better resistive nature towards cryptanalysis than ECB.
• More secure than ECB as it hides patterns.
Disadvantages of CBC
• Requires the previous ciphertext block for encryption and decrypiton
making parallel processing difficult.
Counter Mode
The Counter Mode or CTR is a simple counter-based block cipher
implementation. Every time a counter-initiated value is encrypted and given as
input to XOR with plaintext which results in ciphertext block. The CTR mode is
independent of feedback use and thus can be implemented in parallel.
Advantages of Counter
• Since there is a different counter value for each block, the direct plaintext
and ciphertext relationship is avoided. This means that the same plain text
can map to different ciphertext.
• Parallel execution of encryption is possible as outputs from previous stages
are not chained as in the case of CBC.
Disadvantages of Counter
• The fact that CTR mode requires a synchronous counter at both the
transmitter and the receiver is a severe drawback. The recovery of plaintext
is inaccurate when synchronization is lost.
Passive Attacks
A Passive attack attempts to learn or make use of information from the system
but does not affect system resources. Passive Attacks are in the nature of
eavesdropping on or monitoring transmission. The goal of the opponent is to
obtain information that is being transmitted. Passive attacks involve an attacker
passively monitoring or collecting data without altering or destroying it.
Types of Passive Attacks :-
Type Description
Attacker listens to private communications to gain
Eavesdropping
sensitive information.
Attacker studies the patterns, size, and timing of the
Traffic Analysis
messages, even if encrypted, to deduce useful info.
Security Mechanisms
Security mechanisms are the specific tools, protocols, or procedures employed to
enforce security services. These mechanisms work together to implement and
maintain the desired level of security within an organization's infrastructure.
Examples include encryption algorithms, access control lists, digital signatures,
and secure communication protocols.
Relation between security services and mechanisms
Security Service Security Mechanism
Authentication Biometric scanners, Passwords
Access control lists (ACLs), Role-based access
Authorization
control (RBAC)
Encryption Advanced Encryption Standard (AES), RSA
Integrity Hash functions, Digital signatures
Security Information and Event Management
Auditing and Logging
(SIEM) systems
Intrusion Detection and Intrusion Detection Systems (IDS), Intrusion
Prevention Prevention Systems (IPS)
Firewalls Packet filtering, Stateful inspection
Encryption Technique
The algorithm consists of 2 steps:
1. Generate the key Square (5×5):
• The key square is a 5×5 grid of alphabets that acts as the key for
encrypting the plaintext. Each of the 25 alphabets must be unique and
one letter of the alphabet (usually J) is omitted from the table (as the
table can hold only 25 alphabets). If the plaintext contains J, then it is
replaced by I.
• The initial alphabets in the key square are the unique alphabets of the
key in the order in which they appear followed by the remaining
letters of the alphabet in order.
2. Algorithm to encrypt the plain text: The plaintext is split into pairs of two
letters (digraphs). If there is an odd number of letters, a Z is added to the
last letter.
For example:
Plain Text: “instrumentsz”
Encrypted Text: gatlmzclrqtx
Encryption:
i -> g
n -> a
s -> t
t -> l
r -> m
u -> z
m -> c
e -> l
n -> r
t -> q
s -> t
z -> x
Decryption Technique
Decrypting the Playfair cipher is as simple as doing the same process in reverse.
The receiver has the same key and can create the same key table, and then
decrypt any messages made using that key.
The Algorithm consists of 2 steps:
1. Generate the key Square(5×5) at the receiver’s end:
• The key square is a 5×5 grid of alphabets that acts as the key for
encrypting the plaintext. Each of the 25 alphabets must be unique and
one letter of the alphabet (usually J) is omitted from the table (as the
table can hold only 25 alphabets). If the plaintext contains J, then it is
replaced by I.
• The initial alphabets in the key square are the unique alphabets of the
key in the order in which they appear followed by the remaining
letters of the alphabet in order.
2. Algorithm to decrypt the ciphertext: The ciphertext is split into pairs of two
letters (digraphs).
Note: The ciphertext always have even number of characters.
Rules for Decryption
If both the letters are in the same column: Take the letter above each one (going
back to the bottom if at the top).
If both the letters are in the same row: Take the letter to the left of each one
(going back to the rightmost if at the leftmost position).
If neither of the above rules is true: Form a rectangle with the two letters and
take the letters on the horizontal opposite corner of the rectangle.
For example:
Plain Text: “gatlmzclrqtx”
Decrypted Text: instrumentsz
Decryption:
(red)-> (green)
ga -> in
tl -> st
mz -> ru
cl -> me
rq -> nt
tx -> sz
Advantages:
• Encrypts two letters at a time, making it more secure than simple
substitution.
• Easy to understand and implement manually.
• Provides better resistance to frequency analysis compared to
monoalphabetic ciphers.
Disadvantages:
• Still vulnerable to cryptanalysis with enough ciphertext.
• Cannot handle digits or special characters.
• Merges 'I' and 'J', causing ambiguity.
• Not secure enough for modern encryption needs.
Disadvantages
• Slow processing speed: RSA algorithm is slower than other encryption
algorithms, especially when dealing with large amounts of data.
• Large key size: RSA algorithm requires large key sizes to be secure, which
means that it requires more computational resources and storage space.
• Vulnerability to side-channel attacks: RSA algorithm is vulnerable to
side-channel attacks, which means an attacker can use information leaked
through side channels such as power consumption, electromagnetic
radiation, and timing analysis to extract the private key.
• Limited use in some applications: RSA algorithm is not suitable for some
applications, such as those that require constant encryption and decryption
of large amounts of data, due to its slow processing speed.
• Complexity: The RSA algorithm is a sophisticated mathematical technique
that some individuals may find challenging to comprehend and use.
• Key Management: The secure administration of the private key is
necessary for the RSA algorithm, although in some cases this can be
difficult.
• Vulnerability to Quantum Computing: Quantum computers have the
ability to attack the RSA algorithm, potentially decrypting the data.
Step 3: Splitting
• The permuted block is divided into two 32-bit halves:
o Left Half: L0
o Right Half: R0
Step 4: 16 Rounds of Feistel Structure
Each round (i = 1 to 16) involves the following operations:
1. Expansion (E-box):
o Expand the 32-bit right half Ri-1 to 48 bits using the expansion table
(duplicate certain bits).
2. Key Mixing (XOR):
o XOR the expanded right half with the 48-bit round key (Ki):
E(Ri-1) ⊕ Ki
3. Substitution (S-boxes):
o Divide the 48-bit result into eight 6-bit blocks.
o Pass each block through its corresponding S-box, which reduces it to
4 bits.
o Combine all 8 outputs into a 32-bit block.
4. Permutation (P-box):
o Rearrange the 32-bit output using a fixed P-box permutation.
5. XOR with Left Half:
o New right half: Ri = Li-1 ⊕ P(S(E(Ri-1) ⊕ Ki))
o New left half: Li = Ri-1
This process is repeated for all 16 rounds with a different key for each round.
Step 3: Splitting
• Split the permuted block into two halves:
o Left Half: L0
o Right Half: R0
Advantages of DES
• Simple and easy to implement.
• Efficient in hardware.
• Standardized and widely adopted.
• Basis for stronger algorithms (e.g., Triple DES).
Disadvantages of DES
• Short 56-bit key — vulnerable to brute-force attacks.
• Not secure for modern data protection.
• Susceptible to known cryptanalysis techniques.
• Limited 64-bit block size.
Applications of DES
• Early ATM and banking systems.
• Secure voice/data transmission.
• File encryption (historically).
• Legacy systems (limited modern use).
Working
• AES works on a 4×4 matrix of bytes known as the State.
• The number of rounds depends on the key length:
o 10 rounds for 128-bit key
o 12 rounds for 192-bit key
o 14 rounds for 256-bit key
• Each round involves a series of transformations to increase confusion and
diffusion of the plaintext.
AES Encryption :-
Step 1: Key Expansion
• The 128-bit cipher key is expanded to generate 11 round keys (each 128-
bit).
• These are used in the 10 rounds + initial round.
Advantages:
• Strong Security (against brute-force and cryptanalysis)
• Flexible Key Lengths (128, 192, 256 bits)
• Fast in both hardware and software
• Widely adopted standard (banks, government, cloud)
Disadvantages:
• Complex algorithm compared to DES.
• Key management is critical (especially in large systems).
• Vulnerable if implemented poorly (e.g., side-channel attacks).
5. Applications of AES
• Data encryption for secure storage (e.g., files, databases)
• SSL/TLS encryption in secure web browsing
• Wi-Fi Security (WPA2/WPA3)
• Mobile app and OS encryption
• Cloud computing and VPN encryption
Encryption Steps:
1. Choose a Keyword:
o Select a keyword which will determine the column order for
rearranging characters.
2. Number the Columns:
o Assign numerical positions to each letter in the keyword based on
alphabetical order.
3. Arrange Plaintext in a Grid:
o Write the plaintext row-wise in a matrix under each column of the
keyword.
4. Pad if Necessary:
o If the plaintext doesn’t perfectly fill the grid, pad with a filler
character (e.g., 'X').
5. Read Columns in Numbered Order:
o Rearrange and read the columns according to the numerical order of
the keyword letters to get the ciphertext.
Decryption Steps:
1. Determine Grid Size:
o Calculate the number of rows based on ciphertext length and keyword
length.
2. Reconstruct the Column Order:
o Use the keyword to identify the original order of the columns.
3. Fill the Grid Column-Wise:
o Place the ciphertext into the grid column by column according to the
numbered column order.
4. Read Row-Wise:
o Read the grid row by row to reconstruct the original plaintext.
Goals of Cryptanalysis :-
1. Recover plaintext without knowing the key.
2. Discover the encryption key used.
3. Find weaknesses in cryptographic algorithms.
4. Evaluate the strength of encryption techniques.
Types :-
1. Linear Cryptanalysis
Definition:
Linear cryptanalysis is a statistical method of cryptanalysis that attempts to find a
linear approximation between plaintext, ciphertext, and key bits.
Working:
• Based on discovering linear relationships between:
o Plaintext bits
o Ciphertext bits
o Key bits
• Uses a large number of plaintext-ciphertext pairs.
• Identifies linear expressions that hold true with a probability significantly
different from 0.5.
• After collecting enough data, statistical analysis helps determine key bits.
Differential Cryptanalysis
Definition:
Differential cryptanalysis is a method that studies how differences in input
(plaintext pairs) affect differences in output (ciphertext pairs) under the same
encryption key.
Working:
• Inputs two plaintexts with a known difference (ΔP).
• Observes the corresponding output difference (ΔC).
• Analyzes how input differences propagate through the rounds of
encryption.
• Finds patterns or probabilities that reveal information about the key.
Key Concepts
• Hill cipher works on blocks of letters (block cipher), typically 2x2 or 3x3
matrices.
• It uses modular arithmetic over the alphabet (mod 26 for English
alphabets).
• A key matrix is used for both encryption and decryption.
Advantages:
• Resistant to frequency analysis due to letter grouping.
• Can encrypt multiple letters at once (block cipher).
• Simple to implement using linear algebra.
Disadvantages:
• Key matrix must be invertible mod 26.
• Vulnerable to known-plaintext attack.
• Requires more complex computation compared to simple ciphers.
Applications:
• Mainly educational; not used in modern cryptographic systems.
• Useful for demonstrating the principles of block ciphers and linear
transformations.
# Topic :- Important Differences
Hash and Message Authentication Code
MAC (Message Authentication
Parameter Hash Function
Code)
Ensures both data integrity and
Purpose Ensures data integrity
authenticity
Accepts a message and a secret
Input Accepts a message or data
key
Produces a fixed-size hash Produces a fixed-size
Output
(digest) authentication tag
Applications of PKI:
• SSL/TLS Certificates (HTTPS websites)
• Secure Email (S/MIME)
• Digital Signatures & Documents
• Virtual Private Networks (VPNs)
• Code Signing
Advantages:
• Provides secure communication using encryption.
• Enables authentication through digital certificates.
• Ensures data integrity and non-repudiation.
• Scalable for large networks.
• Centralized trust via Certificate Authorities (CAs).
Disadvantages:
• Complex and costly to implement and maintain.
• Performance overhead due to slower encryption.
• Trust issues if CA is compromised.
• Managing certificate revocation can be challenging.