
Unit 1: Introduction and Classical Ciphers
1.Define the CIA Triad and explain its components. List out the services of security. Differentiate between block ciphers and stream ciphers with examples.
Solution:
CIA Triad:
The CIA Triad is a fundamental model in information security that represents three core principles required to protect information systems.
a) Confidentiality
Ensures that information is accessible only to authorized users.
Prevents unauthorized disclosure of sensitive data.
Achieved using encryption, passwords, and access control.
b) Integrity
Ensures that data remains accurate and unaltered.
Prevents unauthorized modification of information.
Maintained using hashing, checksums, and digital signatures.
c) Availability
Ensures that systems and data are available when needed.
Protects against failures and service disruptions.
Achieved through backups, redundancy, and fault tolerance.
The main security services provided by information security systems are:
Confidentiality – Prevents unauthorized disclosure of data
Integrity – Prevents unauthorized modification of data
Authentication – Verifies the identity of users or systems
Authorization / Access Control – Restricts access to resources
Non-repudiation – Prevents denial of sending or receiving data
Availability – Ensures continuous access to resources
Accountability / Auditing – Tracks user actions through logs
2.Illustrate the concept of security policy and mechanism with an example. Differentiate between block cipher and stream cipher.
Solution:
Security Policy
A security policy is a set of rules and guidelines that defines what is allowed and what is not in a system.
It specifies who can access what resources and under what conditions.
It focuses on “what to protect”.
Example:
“Only authorized staff can access the student database.”
Security Mechanism
A security mechanism is the method or tool used to enforce the security policy.
It implements the rules defined by the security policy.
It focuses on “how to protect”.
Example:
Username–password login and role-based access control to restrict database access.
Illustration (Policy vs Mechanism)
Policy: Only teachers can modify student grades.
Mechanism: Authentication system + access control list that allows grade editing only to teacher accounts.
Summary
Security Policy defines the rules.
Security Mechanism enforces those rules using technical controls.
3.How substitution ciphers are different from transposition ciphers? Given a message M=”CSIT PROGRAM IS A HOT CAKE”, encrypt M using Rail Fence cipher with rail size 3.
Solution:
4.Which one is more secure, monoalphabetic cipher or poly alphabetic cipher? Justify. Using rail fence cipher encrypt the text “LEARNING AND TEACHING ARE DIFFERENT” using 3 as rails.
Solution:
Polyalphabetic cipher is more secure than monoalphabetic cipher.
Justification:
Monoalphabetic cipher uses a single substitution alphabet, so the same plaintext letter always maps to the same ciphertext letter, making it vulnerable to frequency analysis.
Polyalphabetic cipher uses multiple substitution alphabets, so the same plaintext letter can be encrypted as different ciphertext letters.
Because of this variation, polyalphabetic ciphers are harder to break than monoalphabetic ciphers.
Example:
Monoalphabetic: Caesar Cipher
Polyalphabetic: Vigenère Cipher
5.Among monoalphabetic and polyalphabetic cipher, which one is more vulnerable? Justify your statement.
Solution:
Monoalphabetic cipher is more vulnerable than polyalphabetic cipher.
Justification:
In a monoalphabetic cipher, each plaintext letter is always replaced by the same ciphertext letter, creating predictable patterns.
These patterns make it easy to break using frequency analysis.
In contrast, a polyalphabetic cipher uses multiple substitution alphabets, reducing visible patterns and increasing security.
Conclusion:
Because of fixed substitutions and easy pattern detection, monoalphabetic ciphers are more vulnerable.
6.Given the key “HELLOWORLD”, encrypt the plaintext “TURINGTEST” using Play fair cipher.
Solution:
7.Show the encryption of plain text “ALGORITHM” using the key “PSEUDOCODE” using playfair cipher.
Solution:
8.Encrypt the message “INFORMATION” using the Playfair cipher with the keyword “SECURITY”.
Solution:
9.The message “IMOGUN” was encrypted with a Playfair cipher using keyword “GALOIS”. Decrypt the message.
Solution:
10.Using Vignere cipher with key = “worlds”, encrypt the plain text “hello everyone”.
Solution:
11.Differentiate between Symmetric and Asymmetric cipher. Encrypt the message “HELL” using the key “FAIL” using Vernanm cipher.
Solution:
Unit 2: Symmetric Ciphers
1. Describe the Fiestal Cipher structure. Given the key {2B, 7E, 15, 16, 28, AE, D2, A6, AB, F7, 97, 66, 01, 02, 03, 04}, compute the first 4 byte of next key after first iteration, using the following S-Box in AES.
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 63 7C 77 7B F2 6B 6F C5 30 01 67 2B FE D7 AB 76
Solution
Feistel Cipher Structure
The Feistel Cipher structure is a symmetric block cipher design used in many encryption algorithms like Data Encryption Standard.
It divides the plaintext into two halves and processes them through multiple rounds.
2. Explain any two modes of block cipher encryption.
Solution
Modes of Block Cipher Encryption:
Block cipher modes define how plaintext blocks are encrypted using a block cipher algorithm to ensure security.
1. Electronic Codebook (ECB) Mode
In ECB mode, the plaintext is divided into fixed-size blocks, and each block is encrypted independently using the same key.
There is no relationship between blocks, so identical plaintext blocks produce identical ciphertext blocks.
Features
Simple and fast
No chaining between blocks
Easy to implement
Limitation
Not secure because it reveals patterns in data
2. Cipher Block Chaining (CBC) Mode
In CBC mode, each plaintext block is first XORed with the previous ciphertext block before encryption.
This creates a dependency between blocks, improving security.
The first block uses an Initialization Vector (IV).
Features
More secure than ECB
Same plaintext blocks give different ciphertext
Uses IV for first block
3. Let us consider the 4 bits key set as {1100, 1010, 0000, 1111, 0101, 1001} and input text as {1011, 1110, 1011, 1000}. Now trace the first full round operation of the IDEA algorithm.
Solution
4. Show the encryption of plain text "ALGORITHM" using the key "PSEUDOCODE" using Playfair cipher.
Solution
5. Describe the different modes of block cipher.
Solution
Modes of Block Cipher
A mode of operation is the rulebook or technique that tells the cipher how to handle data larger than one block.
It ensures that:
The cipher can process the entire message by breaking it into pieces and encrypting them one by one.
The process remains secure, meaning patterns in the original data don't leak through the encryption.
a. Electronic Code Book (ECB) Mode
The plaintext is divided into fixed-size blocks.
Each block is encrypted independently using the same key.
Same plaintext block always produces same ciphertext block.
Weakness: Patterns in plaintext are visible in ciphertext.
b. Cipher Block Chaining (CBC) Mode
Each plaintext block is XORed with the previous ciphertext block before encryption.
An Initialization Vector (IV) is used for the first block.
Errors in one block affect the next block (error propagation).
More secure than ECB.
c. Cipher Feedback (CFB) Mode
Converts block cipher into a stream cipher.
Previous ciphertext block is encrypted and XORed with plaintext to produce ciphertext.
Uses an IV for the first block.
Suitable for encrypting data smaller than block size.
d. Output Feedback (OFB) Mode
Similar to CFB but XORs the output of the encryption function (not ciphertext) with plaintext.
Errors do not propagate to subsequent blocks.
Used in noisy environments (e.g., satellite communication).
e. Counter (CTR) Mode
A counter value is encrypted and XORed with plaintext.
Counter is incremented for each block.
Allows parallel encryption and decryption.
No error propagation.
6. Divide 3x² + x + 6 by 5x + 3 over GF(9).
Solution
7. Explain the single-round operation in DES. Describe the F function in DES.
Solution
Data Encryption Standard (DES) is a block cipher in Cryptography that encrypts data using 16 rounds of processing.
Single Round Operation in DES:
-
Input 64-bit block is divided into Left (L) and Right (R) halves (32 bits each)
-
For round i:
-
Li=Ri−1
-
-
Ki is the round key
-
Uses XOR operation to combine values
-
After 16 rounds, the halves are combined to produce output
F Function in DES:
Step 1: Expansion (E-box)
Expands 32-bit input to 48 bits
Step 2: Key Mixing
XOR with 48-bit round key
Step 3: Substitution (S-box)
Divide into 8 groups of 6 bits
Each passes through S-box → 4 bits output
Total becomes 32 bits
Step 4: Permutation (P-box)
Rearranges bits to produce final output
8. Encrypt the message "INFORMATION" using the Playfair cipher with the keyword "SECURITY".
Solution
9. Show that the set of integers is Ring under addition and multiplication.
Solution
10. Write down the encryption and decryption process at 2-DES and 3-DES. Explain the Fiestal cipher structure.
Solution
2-DES and 3-DES (Cryptography): Enhanced versions of the Data Encryption Standard that apply DES multiple times with different keys to improve security (confidentiality).
2-DES (Double DES)
- Uses two keys: K1,K2
-
Applies DES encryption twice
-
Intended to increase key size from 56-bit → 112-bit
-
Vulnerable to a Meet-in-the-Middle attack
Encryption Process:
-
Input plaintext
-
First encryption:
Second encryption:
Decryption Process:
-
Input ciphertext
-
First decryption:
Second decryption:
3-DES (Triple DES)
- Uses three keys:
-
Applies DES three times
-
Uses Encrypt–Decrypt–Encrypt (EDE) mode
-
Stronger than 2-DES, resists meet-in-the-middle better
Encryption Process (EDE Mode):
-
Input plaintext
-
First encryption:
Decryption step:
Final encryption:
Decryption Process:
-
Input ciphertext
-
First decryption:
Encryption step:
Final decryption:
Feistel Cipher Structure
The Feistel Cipher structure is a symmetric block cipher design used in many encryption algorithms like Data Encryption Standard.
It divides the plaintext into two halves and processes them through multiple rounds.
11. How encryption is done using IDEA algorithm.
Solution
Round operation in International Data Encryption Algorithm is a sequence of arithmetic and logical transformations using six subkeys per round to achieve confidentiality through confusion and diffusion
IDEA operates on 64-bit plaintext, divided into four 16-bit blocks: P1, P2, P3, P4
Each round uses 6 subkeys (K1–K6) of 16 bits
Uses three operations:
Addition modulo (mod 16)
Multiplication modulo 2(mod 17)
Bitwise XOR
Total 8 identical rounds + 1 output transformation round
Combines operations from different algebraic groups → increases security
12. The message "IMOGUN" was encrypted with a Playfair cipher using keyword "GALOIS". Decrypt the message.
Solution
13. Illustrate the concept of security policy and mechanism with an example. Differentiate between block cipher and stream cipher. Explain the process of key expansion in AES.
Solution
Security Policy:
A set of formal rules that define what is allowed and what is prohibited to ensure confidentiality, integrity, and availability.
Defines access permissions (who can access what)
Specifies security goals (confidentiality, integrity, availability)
Establishes rules and constraints
Independent of implementation (abstract)
Acts as a guideline for system security
Example:
“Only managers can access financial records.”
Security Mechanism:
Methods or techniques used to enforce and implement the security policy.
Provides implementation of policy rules
Includes:
Authentication (identity verification)
Authorization (access control)
Encryption (confidentiality)
Hashing (integrity)
Concrete and system-dependent
Ensures enforcement of policy
Example:
Login system (authentication)
Role-Based Access Control (authorization)
14. What is the role of the prime number in the Euler totient Function? Find the GCD of 12 and 16 using the Euclidean algorithm.
Solution
15. Explain the procedure of mix column transformation in AES with an example.
Solution
Mix Column transformation in AES
A transformation in Advanced Encryption Standard that operates on each column of the state matrix to provide diffusion by mixing the bytes using matrix multiplication in
- Operates on 4-byte column of AES state
-
Each column is treated as a polynomial over
-
Multiplied by a fixed matrix
-
Ensures diffusion (changes spread across bytes)
-
Uses finite field arithmetic (modulo irreducible polynomial
Step-wise Mechanism:
-
Take one column:
-
Multiply with a fixed matrix:
-
Perform multiplication in
-
Multiply by 01 → same value
-
Multiply by 02 → left shift + reduce
-
Multiply by 03 → (02 × value) XOR value
-
Compute new column values:
16. Divide 3x² + 4x + 3 by 5x + 6 over GF(7).
Solution
17. Define Galois field with an example. Explain any two modes of block cipher encryption. Determine the quadratic residues of 7.
Solution
Galois Field :
Galois fields contain a finite number of elements. A Galois field can be represented as pn where n is a positive integer and p is a prime number. The number of elements of a finite field is called its order. The finite field of order pn is generally written as GF(pn).
Two special cases of GF(pn):
- If n = 1 then GF(p)
- If n > 1 then GF(pn)
Example:
-
: Elements =
-
Addition and multiplication are done mod 5
Example operations:
-
-
Modes of Block Cipher
A mode of operation is a technique that describes how to repeatedly apply a block cipher's single-block operation to securely transform amounts of data larger than a block.
a. Electronic Code Book (ECB) Mode
The plaintext is divided into fixed-size blocks.
Each block is encrypted independently using the same key.
Same plaintext block always produces same ciphertext block.
Weakness: Patterns in plaintext are visible in ciphertext.
b. Cipher Block Chaining (CBC) Mode
Each plaintext block is XORed with the previous ciphertext block before encryption.
An Initialization Vector (IV) is used for the first block.
Errors in one block affect the next block (error propagation).
18. Explain the generic model of digital signature process. Consider the two prime numbers 7 and 19. Select 29 as public key and 41 as private key. Encrypt the plaintext 4 and decrypt the cipher text 3 using RSA.
Solution
Generic Model of Digital Signature Process
A digital signature is a technique used to ensure authentication, integrity, and non-repudiation of a message.
It uses public key cryptography to verify the sender’s identity.
It protects data from tampering and forgery.
Message Creation:
Sender prepares the original message (M).
Hash Generation:
Apply a hash function to produce a message digest (H(M)).
Signature Generation:
Encrypt the digest using sender’s private key → forms the digital signature.
Transmission:
Send message + digital signature to the receiver.
Signature Verification:
Receiver decrypts signature using sender’s public key.
Hash Comparison:
Receiver computes hash of received message and compares with decrypted digest.
If both hashes match → message is authentic and unchanged.
Example:
Used in email security, online transactions, and software distribution.
Conclusion: Digital signature ensures secure communication by verifying identity and data integrity.
19. Define CIA triad. State the encryption process of double and triple DES. What is the task of S-Box in DES? Discuss with an example.
Solution
CIA Triad (Cyber Security):
A fundamental security model consisting of Confidentiality, Integrity, and Availability to ensure protection of information systems.
Components of CIA Triad (Points):
1. Confidentiality:
Ensures data is accessible only to authorized users
Prevents unauthorized disclosure
Achieved using: Encryption and Access control
2. Integrity:
Ensures data is accurate and not modified
Prevents unauthorized alteration
Achieved using: Hashing and Digital signatures
3. Availability:
Ensures data and systems are accessible when needed
Prevents service disruption (e.g., attacks/failures)
Achieved using:Backup systems and Redundancy
2-DES and 3-DES (Cryptography): Enhanced versions of the Data Encryption Standard that apply DES multiple times with different keys to improve security (confidentiality).
2-DES (Double DES)
- Uses two keys: K1,K2
- Applies DES encryption twice
- Intended to increase key size from 56-bit → 112-bit
- Vulnerable to a Meet-in-the-Middle attack
Encryption Process:
- Input plaintext
First encryption:
Second encryption:
3-DES (Triple DES)
- Uses three keys:
- Applies DES three times
- Uses Encrypt–Decrypt–Encrypt (EDE) mode
- Stronger than 2-DES, resists meet-in-the-middle better
Encryption Process (EDE Mode):
- Input plaintext
First encryption:
Decryption step:
Final encryption:
S-Box (Substitution Box) in Data Encryption Standard is a nonlinear component used to transform input bits into output bits, providing confusion in cryptography.
Task of S-Box:
Converts 6-bit input into 4-bit output
Introduces confusion (non-linearity) in DES
Makes relationship between input and output complex
Strengthens resistance against cryptanalysis attacks
Example:
Input = 101101 (6 bits)
Row = 1 _ _ _ _ 1 → 11 (binary) = 3
Column = _ 0110 _ → 0110 (binary) = 6
From S-Box table (e.g., S1), value at (row 3, column 6) = 13
Output = 1101 (4-bit binary of 13)
20. Explain the round operation in IDEA.
Solution
Round operation in International Data Encryption Algorithm is a sequence of arithmetic and logical transformations using six subkeys per round to achieve confidentiality through confusion and diffusion
IDEA operates on 64-bit plaintext, divided into four 16-bit blocks: X1, X2, X3, X4
Each round uses 6 subkeys (Z1–Z6) of 16 bits
Uses three operations:
Addition modulo
Multiplication modulo 2
Bitwise XOR
Total 8 identical rounds + 1 output transformation round
Combines operations from different algebraic groups → increases security
Unit 3: Asymmetric Ciphers
1. Illustrate the man in middle attack in Diffie–Hellman key exchange protocol.
Solution
2. Describe the meet in middle attack in Diffie Hellman key exchange protocol.
Solution
3. Why do we need a discrete logarithm? Illustrate with an example.
Solution
Discrete logarithm is a concept in Cryptography used in public key cryptography because it is easy to compute in one direction but hard to reverse, providing security.
- Easy to compute gxmodp
-
Difficult to find x from gxmodp
-
Provides a security foundation for algorithms like Diffie–Hellman
-
Used in key exchange and digital signatures
Example:
Let
Compute:
Checking values:
,
,
Therefore,
Conclusion:
Finding is easy, but finding (discrete log) becomes very difficult for large numbers, which ensures security.
4. Define discrete logarithm. How key generation, encryption, and decryption are done in RSA.
Solution
Discrete Logarithm:
Discrete logarithm is a concept in Cryptography where, given g,p, and y, we find x such that:
- Easy to compute gxmodp
-
Hard to find from the result
-
Basis for cryptographic security
RSA Algorithm:
Key Generation:
Public key = (e,n), Private key = (d,n)
Encryption:
-
Ciphertext:
- The sender uses the receiver’s public key
Decryption:
-
Original message:
- The receiver uses the private key
5. Given p = 61, q = 53. Calculate the public key, private key, and encrypt the message “42”.
Solution
6. Explain the process of public key distribution and secret key distribution using public key cryptography.
Solution
7. Find whether 3 is a primitive root of 7 or not.
Solution
8. Show that Z5 is a field. Encrypt the message using the ElGamal cryptosystem.
Solution
9. Encrypt the message m=13 using the ElGamal cryptosystem.
Solution
State Fermat’s theorem with example. What is the implication of discrete logarithm? Write the algorithm forelse
Unit 4: Cryptographic Hash Functions and Digital Signatures
1. Describe the properties of hash functions. Discuss how hash value is generated using SHA-1 algorithm.
Solution
A hash function is a concept in Cryptography used to convert input data of any size into a fixed-size output (hash value).
Properties of Hash Functions:
Deterministic:
Same input always produces the same hash output
Fixed Length Output:
Generates hash of constant size regardless of input
Pre-image Resistance:
Difficult to find original input from given hash
Second Pre-image Resistance:
Hard to find another input with the same hash
Collision Resistance:
Difficult to find two different inputs with same hash
Fast Computation:
Hash value can be computed quickly
SHA-1 Hash Generation Process:
SHA-1 (Secure Hash Algorithm-1) generates a 160-bit hash value.
Step 1: Padding
Message is padded so its length ≡ 448 mod 512
Step 2: Append Length
Original message length is appended (64 bits)
Step 3: Initialize Buffers
Five 32-bit registers: A, B, C, D, E
Step 4: Process Blocks
Message divided into 512-bit blocks
Each block processed in 80 rounds
Step 5: Compression Function
Uses logical functions, bitwise operations, and constants
Step 6: Final Output
Combine values of A, B, C, D, E
Produces 160-bit hash value
2.Compare the SHA parameters between SHA-1 and SHA-2 families.
Solution
SHA-1 and SHA-2 are hashing algorithms in Cryptography used to generate fixed-size hash values, but they differ in security and parameters.
3. Explain the process of generating message digests using MD4.
Solution
MD4 (Message Digest 4) is a hashing algorithm in Cryptography used to generate a 128-bit message digest from input data.
Process of MD4 Hash Generation:
Step 1: Padding
Message is padded so that its length ≡ 448 mod 512
Adds a ‘1’ bit followed by ‘0’s
Step 2: Append Length
Original message length (64 bits) is appended
Total length becomes multiple of 512 bits
Step 3: Initialize Buffers
Four 32-bit registers: A, B, C, D
Initialized with fixed constants
Step 4: Process Message in Blocks
Divide message into 512-bit blocks
Each block processed separately
Step 5: Three Rounds of Processing
Each block goes through 3 rounds
Uses logical functions (F, G, H) and bitwise operations
Updates values of A, B, C, D
Step 6: Produce Final Digest
Combine A, B, C, D
4. List the operation of computing digest value in different passes of MD4.
Solution
MD4 is a hashing algorithm in Cryptography that computes message digest using three passes (rounds) with different operations.
Operations in Different Passes of MD4:
-
Pass 1 (Round 1):
-
Uses function: F(X,Y,Z)=(X∧Y)∨(¬X∧Z)
-
Performs bitwise AND, OR, NOT operations
-
No additive constant used
-
Pass 2 (Round 2):
-
Uses function: G(X,Y,Z)=(X∧Y)∨(X∧Z)∨(Y∧Z)
-
Includes constant addition (0x5A827999)
-
Provides more mixing than Round 1
-
Pass 3 (Round 3):
-
Uses function: H(X,Y,Z)=X⊕Y⊕Z
-
Includes constant addition (0x6ED9EBA1)
-
Uses XOR for further diffusion
5. Describe the working mechanism of digital signature algorithm.
Solution
Digital signature is a concept in Cryptography used to verify the authenticity and integrity of a message using cryptographic techniques.
Working Mechanism:
Step 1: Key Generation
Generate private key (kept secret)
Generate corresponding public key (shared with others)
Step 2: Message Hashing
Compute hash value (message digest) of the message
Reduces message to fixed-size data
Step 3: Signature Generation
Sender uses private key + hash value
Produces a digital signature
Step 4: Transmission
Send message + digital signature to receiver
Step 5: Signature Verification
Receiver computes hash of received message
Uses sender’s public key to verify signature
If both match → message is valid
6. Explain the concept of digital signatures and differentiate between direct and arbitrated digital signatures.
Solution
Digital signature is a concept in Cryptography used to verify the authenticity and integrity of a message using cryptographic techniques.
Created using the sender’s private key
Verified using the sender’s public key
Ensures authentication (identity of sender)
Ensures integrity (message not altered)
Provides non-repudiation (sender cannot deny sending)
Based on asymmetric key cryptography
Basic Concept:
Sender generates a hash of the message
Encrypts the hash using private key → digital signature
Receiver decrypts using public key
Compares hash values to verify authenticity
Example:
A user signs an email using their private key
Receiver verifies it using the public key
If valid → message is trusted
7. Explain the generic model of digital signature process.
Solution
The generic model of digital signature is a concept in Cryptography that describes the overall process of creating and verifying a digital signature to ensure authenticity and integrity.
Generic Model Process:
Step 1: Message Creation
Sender prepares the original message
Step 2: Hash Generation
Apply a hash function to produce a message digest
Step 3: Signature Generation
Encrypt the digest using sender’s private key
This forms the digital signature
Step 4: Transmission
Send message + digital signature to receiver
Step 5: Signature Verification
Receiver computes hash of received message
Decrypts signature using sender’s public key
Step 6: Comparison
If both hash values match → valid signature
Otherwise → message is tampered or invalid
8.How digital signature generation and verification is done using RSA.
Solution
RSA digital signature is a concept in Cryptography used to sign and verify messages using public and private keys.
Digital Signature Generation (Sender Side):
-
Step 1: Key Generation
-
Generate RSA key pair (private key, public key)
-
Step 2: Hashing the Message
-
Compute message digest using a hash function
-
Step 3: Signature Creation
-
Encrypt the hash using sender’s private key
Signature = Hashdmodn
-
Step 4: Transmission
-
Send message + digital signature to receiver
Digital Signature Verification (Receiver Side):
-
Step 1: Hash Calculation
-
Compute hash of received message
-
Step 2: Decrypt Signature
-
Use sender’s public key
Hash′=Signatureemodn
-
Step 3: Comparison
-
Compare both hash values
-
If equal → valid signature
-
If not → tampered message
9. What is DoS attack?
Solution
Denial of Service (DoS) attack is a concept in Cyber Security where an attacker floods a system, server, or network with excessive requests, making it unavailable to legitimate users.
Aims to disrupt normal services
Overloads system or network resources
Causes slowdown or complete crash
Can originate from a single source (DoS)
If multiple systems are used → Distributed DoS (DDoS)
10. What are the applications of hash functions? Discuss how SHA-1 algorithm generates hash value from a given message.
Solution
Hash function is a concept in Cryptography used to convert data into a fixed-size hash value for security purposes.
Applications of Hash Functions:
Data Integrity Verification:
Ensures data is not altered during transmission
Digital Signatures:
Used to generate message digest before signing
Password Storage:
Stores hashed passwords instead of plain text
Message Authentication Code (MAC):
Used for authentication and integrity
File Verification:
Checks file consistency using hash values
SHA-1 Hash Generation Process:
SHA-1 (Secure Hash Algorithm-1) produces a 160-bit hash value.
Step 1: Padding
Message is padded so that length ≡ 448 mod 512
Step 2: Append Length
Add 64-bit representation of original message length
Step 3: Initialize Buffers
Five 32-bit registers: A, B, C, D, E
Step 4: Process Message Blocks
Divide message into 512-bit blocks
Each block processed in 80 rounds
Step 5: Compression Function
Uses logical functions, constants, and bitwise operations
Step 6: Final Output
Combine A, B, C, D, E
Produces 160-bit hash value
11. Why do we need discrete logarithm? Illustrate with an example. Consider a Diffie-Hellman scheme with a common prime p = 13 between user A and user B. Suppose public key of A is 10 and public key of B is 8. Now determine their private keys and shared secret key. Select any valid primitive root of 13.
Solution
The discrete logarithm is a concept in Cryptography used in public-key cryptography because it is computationally hard to invert, forming the basis of secure key-exchange algorithms like Diffie-Hellman.
- Easy to compute gxmodp
- Hard to find x from gxmodp
- Provides security against attackers
- Used in key exchange and digital signatures
Given:
- Prime p=13
- Choose primitive root g=2 (valid for 13)
- Public key of A: A=10
- Public key of B: B=8
Finding Private Keys:
For A:
Find such that
2amod13=10Checking values:
21=2, 22=4, 23=8, 24=16≡3,
25=6, 26=12, 27=11, 28=9,
29=5, 210=10
Private key of A = 10
For B:
Find b such that
2bmod13=823=8
Private key of B = 3
Shared Secret Key:
Using A’s formula:
K=Bamodp=810mod1382=64≡12,
84=122=144≡1,
88=1
810=88⋅82=1⋅12=12
Using B’s formula:
K=Abmodp=103mod13=1000≡12
Shared Secret Key = 12
12. Define digital signature. Describe the approaches of DSS.
Soluiton
Digital signature is a concept in Cryptography used to verify the authenticity and integrity of a message using cryptographic techniques.
Digital Signature Standard (DSS) is a standard in Cryptography used to generate and verify digital signatures for authentication and integrity.
Approaches of DSS:
Digital Signature Algorithm (DSA):
Standard algorithm specified in DSS
Uses public key cryptography for signature generation and verification
Based on modular arithmetic and discrete logarithm problem
RSA-based Signature Approach:
Uses RSA algorithm for digital signatures
Involves private key for signing and public key for verification
Widely used in secure applications
Elliptic Curve Digital Signature Algorithm (ECDSA):
Uses elliptic curve cryptography
Provides same security with smaller key size
More efficient and faster than RSA/DSA
12 Decrypt the cipher text DRJI with the key
|7 8| using the Hill cipher.
|11 11|
Solution
13.List the properties of hash function. Discuss the first pass of MD4.
Solution
A hash function is a concept in Cryptography used to convert input data into a fixed-size hash value.
Properties of Hash Functions:
-
Deterministic:
-
Same input always produces the same hash value
-
Fixed Length Output:
-
Output size is constant regardless of input size
-
Pre-image Resistance:
-
Difficult to find original input from given hash
-
Second Pre-image Resistance:
-
Hard to find another input with same hash
-
Collision Resistance:
-
Difficult to find two different inputs with same hash
-
Fast Computation:
-
Hash can be computed efficiently
First Pass (Round 1) of MD4:
-
Uses function:
- Performs bitwise operations (AND, OR, NOT)
-
No constant is added in this round
-
Processes 16 operations (one for each word of block)
-
Updates registers A, B, C, D
-
Provides initial mixing of input data
14 Describe the algorithm for SHA -1.
Solution
SHA-1 (Secure Hash Algorithm-1) is a hashing algorithm in Cryptography used to generate a 160-bit message digest from input data.
Algorithm of SHA-1:
-
Step 1: Padding
-
Append a ‘1’ bit followed by ‘0’s
-
Make message length ≡ 448 mod 512
-
Step 2: Append Length
-
Append 64-bit representation of original message length
-
Total length becomes multiple of 512 bits
-
Step 3: Initialize Buffers
-
Five 32-bit registers:
A = 67452301
B = EFCDAB89
C = 98BADCFE
D = 10325476
E = C3D2E1F0
-
Step 4: Process Message in Blocks
-
Divide message into 512-bit blocks
-
Each block expanded into 80 words
-
Step 5: Main Loop (80 Rounds)
-
Perform operations using functions and constants
-
Update A, B, C, D, E in each round
-
Step 6: Add to Previous Hash Value
-
Add results to initial buffer values
-
Step 7: Final Output
-
Concatenate A, B, C, D, E
Produces 160-bit hash value
15. Explain the process of generating message digests using MD4.
Solution
Unit 5: Authentication
1.Define authentication system. Discuss about challenge response system.
Solutoin
An authentication system is a concept in Cyber Security used to verify the identity of a user or system before granting access.
Ensures only authorized users can access resources
Uses methods like passwords, tokens, biometrics
Challenge-Response System:
Challenge-response system is a concept in Cyber Security used to authenticate a user without sending the actual password over the network.
Working Mechanism:
Step 1: Challenge Generation
Server sends a random number (nonce) to the user
Step 2: Response Creation
User computes a response using the nonce and secret key/password
Step 3: Response Transmission
User sends the computed response back to the server
Step 4: Verification
Server performs the same computation
If results match → authentication successful
2.Define authentication system. Illustrate the need of mutual authentication over one way authentication.
Solution
An authentication system is a concept in Cyber Security used to verify the identity of a user or system before granting access.
Ensures only authorized users can access resources
Protects systems from unauthorized access
Need of Mutual Authentication over One-Way Authentication:
One-Way Authentication:
Only one party is verified (e.g., user to server)
Vulnerable to server impersonation attacks
Mutual Authentication:
Both parties verify each other (client and server)
Prevents man-in-the-middle attacks
Ensures trust on both sides
3.Give the formal definition of authentication system. Describe about one way and mutual authentication system.
Solution
An authentication system is a concept in Cyber Security used to verify the identity of a user or system before granting access.
Ensures only authorized users can access resources
Protects systems from unauthorized access
One-Way Authentication:
Only one party is authenticated (usually client → server)
Example: user logs in using username and password
Simple and easy to implement
Does not verify the server’s identity
Vulnerable to impersonation attacks
Mutual Authentication:
Both parties authenticate each other (client ↔ server)
Each side verifies the identity of the other
Provides higher level of security
Prevents man-in-the-middle and impersonation attacks
Used in secure systems (banking, Kerberos, etc.)
Key Difference (Point-wise):
One-way → single-side verification
Mutual → two-way verification
One-way → less secure
Mutual → more secure and reliable
4.What is Message Authentication Code?
Solution
Message Authentication Code (MAC) is a concept in Cryptography used to ensure data integrity and authentication by generating a fixed-size code using a secret key and the message.
Computed using message + shared secret key
Ensures message authenticity (sender is valid)
Detects any modification in data
Produces a fixed-length output (MAC value)
Used in secure communication protocols
5.Describe about Needham-Schroeder protocol.
Solution
Needham-Schroeder protocol is a concept in Cryptography used for secure authentication between two parties using a trusted third party.
Establishes a secure session key between users
Uses a Key Distribution Center (KDC)
Prevents unauthorized access
Exists in symmetric key and public key versions
Working Mechanism (Symmetric Key Version):
Step 1:
User A sends a request to KDC to communicate with User B
Step 2:
KDC generates a session key and sends it to A
(encrypted using A’s secret key)
Step 3:
A forwards part of the message (ticket) to B
Step 4:
B decrypts and obtains the session key
Step 5:
A and B use the session key for secure communication
6.Discuss the working mechanism of kerberos protocol.
Solution
Kerberos is a protocol in Cyber Security used for secure authentication in distributed systems using tickets and a trusted third party.
Working Mechanism:
Step 1: User Login (Authentication Server - AS)
User enters credentials
AS verifies and issues a Ticket Granting Ticket (TGT)
Step 2: Request to Ticket Granting Server (TGS)
User sends TGT to TGS to request access to a service
TGS verifies TGT
Step 3: Service Ticket Issuance
TGS issues a service ticket for the requested service
Includes session key
Step 4: Access Service Server
User sends service ticket to service server
Server verifies and grants access
7.Why do we need Kerberos?
Solution
Kerberos is needed in Cyber Security to provide secure authentication in distributed systems.
Prevents password transmission over network
Protects against replay attacks
Enables single sign-on (SSO)
Provides mutual authentication
Suitable for large network environments
Unit 6: Network Security and Public Key Infrastructure
1.What is digital certificate? Discuss the certificate life cycle.
Solution
A digital certificate is a concept in Cyber Security used to verify the identity of a user, device, or website using cryptographic techniques, issued by a trusted Certificate Authority (CA).
Contains public key, owner identity, issuer details
Used in secure communication (e.g., HTTPS)
Ensures authentication, integrity, and trust
Prevents impersonation attacks
Certificate Life Cycle:
Registration:
User requests a certificate from a Certificate Authority (CA)
Provides identity information
Verification:
CA verifies the authenticity of the applicant
Ensures the request is legitimate
Issuance:
CA issues the digital certificate
Certificate is digitally signed by CA
Distribution:
Certificate is delivered to the user
Made available for use in secure communication
Usage:
Used for authentication and encryption
Example: secure web browsing, email security
Renewal:
Certificate is renewed before expiration
Requires re-verification
Revocation:
Certificate is canceled before expiry if compromised
Added to revocation list (CRL)
Expiration:
Certificate becomes invalid after its validity period
2. Describe the PKI trust model.
Solution
The PKI (Public Key Infrastructure) trust model is a concept in Cyber Security that defines how trust is established and managed using digital certificates and Certificate Authorities (CAs).
It is based on a hierarchy of trust
A Root CA is the most trusted authority
Root CA issues certificates to Intermediate CAs
Intermediate CAs issue certificates to end users or servers
Trust is established through a chain of certificates (chain of trust)
If the Root CA is trusted, all certificates under it are trusted
Ensures authentication, integrity, and secure communication
Example:
When you visit a secure website (HTTPS):
The website provides its digital certificate
Your browser checks the certificate chain up to the Root CA
If the Root CA is trusted → connection is secure
4.Define PKI with its architecture model.
Solution
Public Key Infrastructure (PKI) is a concept in Cyber Security that provides a framework for managing public key encryption, digital certificates, and secure communication.
Enables authentication, confidentiality, and integrity
Uses public and private key pairs
Relies on trusted entities for certificate management
Widely used in secure web communication (HTTPS), email, etc.
PKI Architecture Model:
Certificate Authority (CA):
Trusted entity that issues and signs digital certificates
Registration Authority (RA):
Verifies the identity of users before certificate issuance
Acts as an intermediary between user and CA
End Users (Subscribers):
Individuals or systems that request and use certificates
Repository:
Stores and distributes certificates and CRLs (Certificate Revocation Lists)
Digital Certificates:
Bind a public key with the identity of the owner
CRL (Certificate Revocation List):
List of revoked certificates
5. Explain IP Security (IPSec) and its components.
Solution
IP Security (IPSec) is a protocol suite in Cyber Security used to secure IP communication by providing encryption, authentication, and integrity at the network layer.
Works at the IP layer
Secures data between hosts or networks
Used in VPNs (Virtual Private Networks)
Protects against eavesdropping and tampering
Components of IPSec:
Authentication Header (AH):
Provides authentication and integrity
Ensures data is not altered
Does not provide encryption
Encapsulating Security Payload (ESP):
Provides encryption, authentication, and integrity
Protects confidentiality of data
Most commonly used component
Security Association (SA):
Defines security parameters between sender and receiver
Includes keys, algorithms, and protocols used
Internet Key Exchange (IKE):
Used to establish and manage keys
Automates negotiation of security parameters
6. Describe the services provided by Pretty Good Privacy protocol to secure email.
Solution
Pretty Good Privacy (PGP) is a protocol in Cyber Security used to secure email communication using encryption and authentication techniques.
Services provided by PGP:
Confidentiality:
Encrypts email using public key encryption
Ensures only the intended recipient can read the message
Authentication:
Uses digital signatures to verify the sender’s identity
Confirms that the message is from a legitimate sender
Integrity:
Uses hash functions to ensure the message is not altered
Any modification can be detected
Non-repudiation:
Sender cannot deny sending the message due to digital signature
Compression:
Compresses message before encryption
Reduces size and improves efficiency
Email Compatibility:
Converts binary data into ASCII format (Radix-64 encoding)
Ensures compatibility with email systems
8.What is the use of firewall? How circuit level gateway differs from stateful inspection firewall?
Solution
Firewall is a concept in Cyber Security used to monitor and control incoming and outgoing network traffic based on predefined security rules.
The use of firewall are
Prevents unauthorized access
Monitors and filters network traffic
Protects against attacks and threats
Enforces security policies
Acts as a barrier between trusted and untrusted networks
9. Write down any two limitations of MAC. What do policy and mechanism mean in cryptography? Describe with a scenario.
Solution
Limitations of MAC (Message Authentication Code):
MAC is a concept in Cryptography used to ensure data integrity and authentication using a shared secret key.
No Non-repudiation:
Both sender and receiver share the same key
Receiver can also generate MAC → sender cannot be uniquely proven
Key Distribution Problem:
Secret key must be securely shared beforehand
Difficult to manage in large systems
Policy and Mechanism in Cryptography:
Policy:
Defines what security is required
Specifies rules like who can access what data
Mechanism:
Defines how the policy is implemented
Uses tools like encryption, MAC, digital signatures
Scenario:
Consider an online banking system:
Policy: Only the account holder can access and transfer money.
Mechanism:
Use password + OTP authentication
Use encryption (SSL/TLS) to secure communication
Policy = rule, Mechanism = implementation of that rule
10. What is the task of a firewall? List the elements of X.509.
Solution
Firewall is a concept in Cyber Security used to monitor and control incoming and outgoing network traffic based on predefined security rules.
The use of firewall are
Prevents unauthorized access
Monitors and filters network traffic
Protects against attacks and threats
Enforces security policies
Acts as a barrier between trusted and untrusted networks
Elements of X.509 Certificate:
X.509 is a standard in Cryptography for digital certificates.
Version:
Specifies the version of X.509 standard used
Determines available features and fields
Serial Number:
Unique number assigned by the Certificate Authority (CA)
Used to identify and track certificates
Signature Algorithm Identifier:
Specifies the algorithm used to sign the certificate
Ensures verification of authenticity
Issuer Name:
Identifies the CA that issued the certificate
Helps establish trust chain
Validity Period:
Defines start and expiry date of certificate
Ensures certificate is used within valid time
Subject Name:
Identifies the owner of the certificate
Can be a user, organization, or website
Subject Public Key Information:
Contains the public key of the subject
Used for encryption and verification
Extensions:
Provides additional information (e.g., usage, constraints)
Enhances flexibility of the certificate
Digital Signature:
Signature of CA to verify certificate integrity
Confirms certificate is authentic and unchanged
11. Define SSL protocol.
Solution
SSL (Secure Sockets Layer):
SSL is a protocol in Cyber Security used to secure communication over a network by encrypting data between client and server.
Provides data encryption for secure transmission
Ensures confidentiality and integrity
Uses public key and symmetric key cryptography
Commonly used in HTTPS for secure web browsing
12. List and explain the types of firewalls.
Solution
Firewall is a concept in Cyber Security used to monitor and control incoming and outgoing network traffic based on predefined security rules.
Types of Firewall:
Packet Filtering Firewall:
Filters packets based on IP address, port number, and protocol
Works at the network layer
Fast but provides limited security
Does not track connection state
Stateful Inspection Firewall:
Monitors active connections and keeps track of their state
Allows packets based on context (state of communication)
More secure than packet filtering
Works at network and transport layers
Application-Level Gateway (Proxy Firewall):
Acts as an intermediary between user and server
Filters traffic at the application layer
Provides high security by inspecting full data
Slower due to deep inspection
Circuit-Level Gateway:
Monitors TCP handshakes and sessions
Ensures connections are legitimate
Does not inspect actual data packets
Faster but less secure than proxy firewall
Unit 7: Malicious Logic
1. Describe any three types of malicious logic.
Solution
Malicious logic is a concept in Cyber Security that refers to harmful code intentionally inserted into a system to disrupt, damage, or gain unauthorized access.
Types of Malicious Logic:
Virus:
A virus is a program that attaches itself to legitimate files and spreads when those files are executed.
Requires user action to activate
Can corrupt or delete data
Spreads from one system to another
Worm:
A worm is a standalone program that replicates itself automatically over networks without user intervention.
Does not need a host file
Spreads rapidly across systems
Consumes network bandwidth and system resources
Trojan Horse:
A Trojan is a malicious program disguised as legitimate software to trick users.
Appears useful or harmless
Creates backdoors for attackers
Can steal sensitive information
2. What is malicious logic? How zombies are different from trojan horses?
Solution
Malicious Logic:
Malicious logic is a concept in Cyber Security that refers to harmful code intentionally inserted into a system to disrupt, damage, or gain unauthorized access
Inserted into software with harmful intent
Can disrupt system operations
May steal or modify data
Often hidden from users
Used by attackers to gain control or access
3. Differentiate between Trojan horse and virus
Solution
4. What is intrusion? Explain any two types of intrusion detection system.
Solution
Intrusion:
Intrusion is a concept in Cyber Security that refers to unauthorized access or activity in a computer system or network that compromises security.
Violates system security policies
May involve data theft, modification, or disruption
Can be performed by insiders or external attackers
Threatens confidentiality, integrity, and availability
Types of Intrusion Detection System (IDS):
Host-Based Intrusion Detection System (HIDS):
Monitors activities on a single computer (host)
Analyzes system logs, file changes, and processes
Detects unauthorized access or modifications
Useful for detecting internal attacks
Network-Based Intrusion Detection System (NIDS):
Monitors network traffic across multiple systems
Analyzes packets for suspicious patterns
Detects attacks like scanning, DoS, etc.
Useful for detecting external threats
5. Explain the concept of a denial of service attack and provide examples.
Solution
Denial of Service (DoS) Attack:
A denial of service attack is a concept in Cyber Security where an attacker overloads a system, server, or network with excessive requests, making it unavailable to legitimate users.
Aims to disrupt normal service
Targets servers, websites, or networks
Makes resources unavailable or slow
Can be launched from a single system (DoS) or multiple systems (DDoS)
Exploits system or network weaknesses
Examples:
Traffic Flooding Attack:
Attacker sends a large number of requests to a server, exhausting its resources and causing slowdown or crash.
SYN Flood Attack:
Attacker sends multiple fake connection requests (SYN packets) without completing them, filling up the server’s connection queue.
Ping of Death:
Attacker sends oversized or malformed packets that crash the target system.
6. How does the nature of worms differ from viruses?
Solution
Worms and viruses are types of malicious logic in Cyber Security, but they differ in how they spread and operate.
7.Write short notes on:
a. Classes of Intruder
Solution
Classes of intruders is a concept in Cyber Security that classifies attackers based on their level of access and intent.
Masquerader:
An outsider who pretends to be an authorized user
Gains access using stolen credentials
Misfeasor:
A legitimate user who misuses their privileges
Accesses data or resources beyond permission
Clandestine User:
An attacker who gains administrative control
Can bypass security and hide activities
b. SSL (Secure Sockets Layer)
Solution
SSL is a protocol in Cyber Security used to secure communication over a network by encrypting data between client and server.
Provides data encryption
Ensures data confidentiality and integrity
Uses public key and symmetric key encryption
Works between application and transport layer
Commonly used in HTTPS (secure web browsing)
Prevents eavesdropping and tampering
c. DoS Attack (Denial of Service Attack)
Solution
A DoS attack is a concept in Cyber Security where a system is overloaded with excessive requests, making it unavailable to legitimate users.
Aims to disrupt services
Exhausts system or network resources
Can be DoS (single source) or DDoS (multiple sources)
Causes slowdown or complete crash
Targets servers, websites, or networks
Example: SYN flood, traffic flooding
Miscellaneous / Cross-Chapter Questions
1. Show that the set of integers is a ring under addition and multiplication
Solution
A ring is a concept in Abstract Algebra defined as a set equipped with two operations (addition and multiplication) satisfying certain properties.
Let Z be the set of integers.
Verification of Ring Properties
-
Closure under Addition and Multiplication:
For any a,b∈Z,
a+b∈Z and a⋅b∈Z
-
Associativity:
Addition: (a+b)+c=a+(b+c)
Multiplication: (a⋅b)⋅c=a⋅(b⋅c)
-
Additive Identity:
There exists 0∈Z such that
a+0=a
-
Additive Inverse:
For every a∈Z, there exists −a∈Z such that
a+(−a)=0
-
Distributive Laws:
a⋅(b+c)=a⋅b+a⋅c
(a+b)⋅c=a⋅c+b⋅c
Conclusion
Since all ring properties are satisfied,
The set of integers forms a ring under addition and multiplication.
2. Define Euler totient function with an example.
Solution
Euler totient function is a concept in Number Theory that gives the number of positive integers less than or equal to that are coprime to . (i.e., gcd(n,k)=1).
It is denoted by Ï•(n).
-
Counts integers relatively prime to
-
Values range from 1 to .
-
If p is prime, then Ï•(p)=p−1
-
Important in modular arithmetic and cryptographyExample:
Find Ï•(12)
Numbers ≤ 12:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
Coprime with 12:
1, 5, 7, 11
Ï•(12)=4