Unit–1: Introduction of Cryptography
Introduction to Security
Security means protecting information from unauthorized access, misuse, or destruction. In
today’s digital world, data is shared over the internet, so security is very important.
Security ensures that information is accessed only by authorized users. It also ensures that
data is not modified, not stolen, and not destroyed.
Example
• ATM PIN
• Online banking
• WhatsApp messages
Without security, hackers can steal passwords, change marks, or transfer money illegally.
Hence, security is the backbone of modern communication systems.
Security Attacks
A security attack is an attempt to steal, alter, or damage data.
Types of Attacks
(a) Passive Attack
In passive attack, the attacker only observes data but does not change it.
Example:
Listening to a phone call secretly.
(b) Active Attack
In active attack, attacker modifies or destroys data.
Example:
Hacker changing marks in college database.
Security attacks are dangerous because they can cause financial loss and privacy issues.
Security Services
Security services protect data from attacks and provide safe communication.
Main Security Services
1. Confidentiality – Keeps data secret
Example: Encrypted messages
2. Integrity – Prevents data modification
Example: Bank transaction records
3. Authentication – Verifies user identity
Example: OTP verification
4. Non-Repudiation – Sender cannot deny sending data
Example: Digital signatures
These services together ensure complete security.
Security Mechanisms
Security mechanisms are methods used to provide security services.
Common Mechanisms
• Encryption
• Digital signatures
• Hash functions
• Access control
Example
Encryption converts readable data into unreadable form to protect it from hackers.
Security mechanisms act as tools to enforce security policies.
Conventional Encryption (Symmetric Encryption)
Conventional encryption uses the same secret key for encryption and decryption.
Working
• Sender encrypts message using secret key
• Receiver decrypts message using same key
Example
Room key used for locking and unlocking.
Advantages
• Fast
• Easy to implement
Disadvantage
• Key distribution problem
Conventional Encryption Model
This model explains how encryption works.
Components
1. Plaintext – Original message
2. Encryption algorithm – Converts plaintext
3. Secret key – Used for encryption
4. Ciphertext – Encrypted message
5. Decryption algorithm – Converts back to plaintext
Example
HELLO → Encryption → XQZP@ → Decryption → HELLO
This model ensures secure communication.
Steganography
Steganography means hiding a message inside another file so that no one knows the
message exists.
Example
• Hiding text inside image
• Hiding audio inside video
Difference from Encryption
• Encryption hides content
• Steganography hides existence
Steganography is used for secret communication.
Block Cipher Principles
In block cipher, data is divided into fixed-size blocks and each block is encrypted separately.
Example
• Block size = 64 bits
• Message divided into blocks
• Each block encrypted using key
Block ciphers provide strong security.
Data Encryption Standard (DES)
DES is a symmetric block cipher.
Features
• Block size: 64 bits
• Key size: 56 bits
• Number of rounds: 16
DES was widely used in early banking systems.
Strength of DES
Strengths
• Simple design
• Fast encryption
Weakness
• Small key size
• Vulnerable to brute force attack
Because of weak key size, DES is now outdated.
Differential Cryptanalysis
It is a method used to break block ciphers.
Working
• Compare input differences
• Observe output differences
• Guess secret key
Used mainly to attack DES.
Linear Cryptanalysis
It uses linear equations to find relationship between plaintext, ciphertext, and key.
Example
Using mathematical analysis to guess key bits.
It is simpler than brute force attack.
Block Cipher Modes of Operation
Used to encrypt large data.
Types
1. ECB – Same plaintext → same ciphertext
2. CBC – Each block depends on previous block
3. CFB/OFB – Used for streaming data
CBC is more secure than ECB.
Double DES
DES encryption is applied two times using two keys.
Advantage
• More secure than DES
Disadvantage
• Vulnerable to meet-in-the-middle attack
Triple DES (3DES)
DES applied three times using three keys.
Advantages
• Very secure
• Used in banking systems
Disadvantage
• Slow compared to modern algorithms
Blowfish
Blowfish is a fast and secure block cipher.
Features
• Key size: 32–448 bits
• Free to use
• Fast performance
Used in file encryption tools.
International Data Encryption Algorithm (IDEA)
IDEA is a strong block cipher.
Features
• Block size: 64 bits
• Key size: 128 bits
• Very secure
Used in PGP encryption.
Placement of Encryption Function
Encryption can be placed at different levels.
Types
1. Link encryption
2. End-to-end encryption
Example
WhatsApp uses end-to-end encryption.
Key Distribution
Key distribution means secure sharing of secret keys.
Methods
• Manual sharing
• Trusted third party
• Key Distribution Center
Improper key distribution leads to security risks.
Random Number Generation
Random numbers are used for keys and passwords.
Types
• True random
• Pseudo random
Weak random numbers cause easy hacking.
Traffic Confidentiality
Traffic confidentiality hides communication patterns.
Example
Attacker should not know:
• Who is communicating
• How much data is sent
It protects privacy in networks.
Unit–2: Number Theory and Public Key Encryption
Fermat’s Little Theorem (10 Marks)
Fermat’s Little Theorem is an important concept in number theory and cryptography. It is
mainly used to simplify large power calculations in modular arithmetic, which is required in
public key encryption systems.
Statement
If p is a prime number and a is an integer such that p does not divide a, then:
𝑎𝑝−1 ≡ 1 (mod 𝑝)
Example
Let a = 2 and p = 5
24 = 1616mod 5 = 1
Importance
• Used in public key algorithms like RSA
• Helps in fast modular exponentiation
• Reduces computation complexity
Thus, Fermat’s theorem forms the basic foundation of cryptography.
Euler’s Theorem (10 Marks)
Euler’s Theorem is a general form of Fermat’s theorem. It is used when the modulus number
is not prime.
Statement
If gcd(a, n) = 1, then:
𝑎𝜙(𝑛) ≡ 1 (mod 𝑛)
where φ(n) is Euler’s Totient Function, which gives the count of numbers less than n and
coprime with n.
Example
Let n = 10
φ(10) = 4
34 = 8181mod 10 = 1
Importance
• Used in RSA key generation
• Works with composite numbers
• Helps in encryption and decryption
Euler’s theorem is very important in public key cryptography.
Primality Testing (10 Marks)
Primality testing is the process of determining whether a given number is prime or not.
Prime numbers are very important in cryptography, especially in RSA.
Prime Number
A number divisible only by 1 and itself.
Methods
• Trial division
• Fermat primality test
• Miller–Rabin test
Example
Check 13:
13 is divisible only by 1 and 13 → Prime number
Importance
• RSA requires large prime numbers
• Strong security depends on primes
• Wrong prime selection weakens encryption
Hence, primality testing is a critical step in cryptographic systems.
Chinese Remainder Theorem (CRT) (10 Marks)
The Chinese Remainder Theorem is used to solve a system of simultaneous modular
equations. It gives a unique solution when moduli are coprime.
Statement
If moduli are pairwise coprime, then there exists a unique solution modulo their product.
Example
𝑥 ≡ 1 (mod 2)𝑥 ≡ 2 (mod 3)
Solution:
x=5
Importance
• Used to speed up RSA decryption
• Reduces computation time
• Improves system efficiency
CRT improves performance in cryptographic algorithms.
Public-Key Cryptography (10 Marks)
Public-key cryptography is an encryption technique that uses two different keys.
Types of Keys
• Public key – Shared openly
• Private key – Kept secret
Working
• Sender encrypts data using receiver’s public key
• Receiver decrypts data using private key
Example
RSA algorithm
Advantages
• Solves key distribution problem
• Secure communication over internet
Public-key cryptography is widely used in online security systems.
Principles of Public-Key Cryptosystems (10 Marks)
A public-key cryptosystem works on the following principles:
1. Key pair generation should be easy
2. Encryption using public key should be easy
3. Decryption using private key should be easy
4. Finding private key from public key should be computationally difficult
Example
Anyone can encrypt a message, but only the receiver can decrypt it.
These principles ensure confidentiality and security.
RSA Algorithm (10 Marks)
RSA is the most widely used public-key encryption algorithm.
Steps of RSA Algorithm
1. Choose two large prime numbers p and q
2. Compute n = p × q
3. Compute φ(n) = (p−1)(q−1)
4. Choose public key e such that gcd(e, φ(n)) = 1
5. Compute private key d
6. Encryption:
𝐶 = 𝑀𝑒 (mod 𝑛)
7. Decryption:
𝑀 = 𝐶 𝑑 (mod 𝑛)
Example (Simple)
If message M = 5, encryption gives cipher text C, and decryption restores M.
Advantages
• Very secure
• Used in SSL, digital signatures
Disadvantage
• Slower than symmetric encryption
RSA provides secure data transmission over the internet.
Exam Writing Tip (Important)
For 10 marks, always include:
• Definition
• Formula or principle
• Example
• Importance or application
Unit–3: Key Management
Key Management Scenario in Secret Key Cryptography (10 Marks)
Key management in secret key (symmetric) cryptography deals with the generation,
distribution, storage, and protection of secret keys. In this system, the same key is used for
both encryption and decryption.
Key Management Process
• A secret key is generated
• The key must be securely shared between sender and receiver
• The key must be kept secret from attackers
Problem in Secret Key Cryptography
The main problem is key distribution. If the key is intercepted during transmission, security
is lost.
Example
In DES or AES, the same secret key is shared between two users to encrypt and decrypt data.
Importance
• Simple and fast encryption
• Suitable for small networks
• Not scalable for large networks
Thus, key management is difficult in secret key cryptography due to secure key sharing
issues.
Key Management Scenario in Public Key Cryptography (10 Marks)
In public key cryptography, key management is easier compared to secret key systems. It
uses two different keys: a public key and a private key.
Key Management Process
• Each user generates a key pair
• Public key is distributed openly
• Private key is kept secret by the owner
Advantage
There is no need to share the private key, which solves the key distribution problem.
Example
RSA algorithm where the public key is used for encryption and private key for decryption.
Importance
• More secure key distribution
• Scalable for large networks
• Widely used in internet security
Public key cryptography provides better and safer key management.
Diffie–Hellman Key Exchange Algorithm (10 Marks)
Diffie–Hellman is a key exchange algorithm used to securely share a secret key over an
insecure channel. It does not encrypt data but helps in key generation.
Working Steps
1. Two users agree on a public prime number p and base g
2. Each user selects a private number
3. Public values are exchanged
4. Both users compute the same secret key
Example
Even if an attacker sees public values, they cannot compute the secret key.
Importance
• First public key algorithm
• Secure key exchange over internet
• Used in VPNs and SSL
Diffie–Hellman solves the key sharing problem securely.
OAKLEY Key Management Protocol (10 Marks)
OAKLEY is a key exchange protocol used to establish secure and authenticated keys over the
internet. It is based on the Diffie–Hellman algorithm.
Features
• Supports different key exchange methods
• Provides protection against replay attacks
• Uses authentication mechanisms
Example
Used in secure network communications like VPNs.
Importance
• Strong security
• Flexible key exchange
• Prevents common attacks
OAKLEY improves the security of key management systems.
ISAKMP Key Management Protocol (10 Marks)
ISAKMP (Internet Security Association and Key Management Protocol) is used to define
procedures for key exchange and security association management.
Functions
• Establishes security associations
• Negotiates security parameters
• Manages authentication
Example
ISAKMP is used along with OAKLEY in IPsec.
Importance
• Provides framework for secure communication
• Works with multiple key exchange protocols
• Used in modern network security
ISAKMP plays an important role in internet security protocols.
Elliptic Curve Cryptography (ECC) (10 Marks)
Elliptic Curve Cryptography is a public key cryptography technique based on mathematical
properties of elliptic curves.
Features
• Uses smaller key sizes
• Provides high security
• Faster than RSA
Example
ECC with 256-bit key gives security equal to 3072-bit RSA key.
Advantages
• Low memory usage
• Suitable for mobile devices
• Strong security
ECC is widely used in modern cryptographic systems like SSL and cryptocurrencies.
Exam Writing Tip (Very Important)
For 10 marks answers, always include:
• Definition
• Working or explanation
• Example
• Advantages / importance
Unit–4: Hash Functions
Message Authentication and Hash Functions (10 Marks)
Message authentication is the process of verifying that a message is genuine and has not
been altered during transmission. Hash functions play an important role in message
authentication.
A hash function takes a message of any size and converts it into a fixed-length output, called
a message digest. This digest is unique for each message.
Example
If the message changes even slightly, the hash value changes completely.
Importance
• Ensures data integrity
• Detects message tampering
• Widely used in secure communication
Thus, hash functions help in ensuring message authenticity and integrity.
Authentication Requirements (10 Marks)
Authentication requirements define what security properties are needed to verify a
message and its sender.
Main Requirements
• Data Integrity – Message should not be modified
• Authentication – Sender identity must be verified
• Non-repudiation – Sender cannot deny sending message
• Freshness – Message should be recent
Example
Online banking transactions require authentication to ensure data is correct and sent by the
right user.
Authentication requirements ensure trustworthy communication.
Authentication Functions (10 Marks)
Authentication functions are cryptographic techniques used to provide message
authentication.
Types of Authentication Functions
• Message encryption
• Message Authentication Codes (MAC)
• Hash functions
Example
A hash value attached with a message to verify integrity.
Importance
• Protects against message modification
• Ensures secure data transfer
Authentication functions are essential for secure networks.
Message Authentication Codes (MAC) (10 Marks)
A Message Authentication Code (MAC) is a short piece of information used to verify the
authenticity and integrity of a message using a secret key.
Working
• Sender generates MAC using message and secret key
• Receiver uses the same key to verify MAC
Example
HMAC used in secure APIs.
Advantages
• Ensures integrity and authentication
• Fast and efficient
MACs are widely used in secure communication protocols.
Hash Function Birthday Attacks (10 Marks)
A birthday attack is a cryptographic attack that exploits the probability of hash collisions.
Due to the birthday paradox, it is easier to find two different messages with the same hash
value.
Example
In a 128-bit hash, collision can be found with about 264 attempts.
Impact
• Weakens hash security
• Can lead to forgery
Birthday attacks show why strong hash functions are necessary.
Security of Hash Functions and MACs (10 Marks)
The security of hash functions and MACs depends on their ability to resist attacks.
Security Properties
• Collision resistance
• Pre-image resistance
• Second pre-image resistance
Example
SHA-256 is more secure than MD5.
Strong security ensures data integrity and authentication.
MD5 Message Digest Algorithm (10 Marks)
MD5 is a widely known hash algorithm that produces a 128-bit hash value.
Features
• Fixed output size
• Fast computation
• Processes message in blocks
Example
Used earlier for file integrity checking.
Limitation
• Vulnerable to collision attacks
Hence, MD5 is now considered insecure.
Secure Hash Algorithm (SHA) (10 Marks)
SHA is a family of cryptographic hash functions designed for better security.
Versions
• SHA-1
• SHA-256
• SHA-512
Example
SHA-256 used in blockchain and SSL.
Advantages
• Strong collision resistance
• High security
SHA is widely used in modern cryptographic systems.
Digital Signatures (10 Marks)
A digital signature is a technique used to verify the authenticity of a digital message using
public key cryptography.
Working
• Sender signs message using private key
• Receiver verifies using public key
Example
Digital signatures used in online documents.
Importance
• Ensures authenticity
• Provides non-repudiation
Digital signatures are essential for secure digital communication.
Digital Signature Standard (DSS) (10 Marks)
DSS is a standard defined for digital signature algorithms, mainly based on DSA.
Features
• Uses public key cryptography
• Ensures message authenticity
• Provides non-repudiation
Example
Used in government and financial systems.
DSS provides a standardized and secure digital signature method.
Exam Writing Tip (Very Important)
For 10 marks, always include:
• Definition
• Explanation / working
• Example
• Importance or advantages
Unit–5: Network and System Security
Authentication Applications: Kerberos (10 Marks)
Kerberos is a network authentication protocol used to verify the identity of users and
systems in a secure manner. It uses secret key cryptography and a trusted third party.
Working
Kerberos uses a Key Distribution Center (KDC) which has two parts:
• Authentication Server (AS)
• Ticket Granting Server (TGS)
The user first authenticates to the AS, then receives a ticket from TGS to access services.
Example
Used in Windows domain networks.
Advantages
• Strong authentication
• Password not sent over network
Kerberos provides secure authentication in distributed systems.
X.509 Authentication (10 Marks)
X.509 is a standard for public key certificates used to verify identities in networks.
Features
• Uses digital certificates
• Issued by Certificate Authority (CA)
• Contains public key and user identity
Example
SSL certificates used in websites.
Importance
• Prevents identity spoofing
• Used in secure web communication
X.509 plays a key role in public key infrastructure (PKI).
Electronic Mail Security (10 Marks)
Electronic mail security ensures that emails are secure, authentic, and private.
Security Services
• Confidentiality
• Authentication
• Integrity
• Non-repudiation
Techniques
• Encryption
• Digital signatures
Example
Secure business emails.
Email security protects messages from eavesdropping and forgery.
Pretty Good Privacy (PGP) (10 Marks)
PGP is a widely used program for email security. It uses a combination of symmetric and
public key cryptography.
Working
• Message is encrypted using a session key
• Session key encrypted using receiver’s public key
Example
Used for secure email communication.
Advantages
• Strong security
• Compression and authentication
PGP provides complete email security.
S/MIME Security (10 Marks)
S/MIME (Secure/Multipurpose Internet Mail Extensions) is a standard for secure email
communication.
Features
• Uses X.509 certificates
• Supports encryption and digital signatures
Example
Secure corporate emails.
Importance
• Ensures confidentiality and integrity
• Widely supported by email clients
S/MIME is used for secure electronic mail systems.
IPsec Architecture (10 Marks)
IPsec is a framework used to secure IP layer communication.
Components
• Authentication Header (AH)
• Encapsulating Security Payload (ESP)
• Security Associations (SA)
Example
Used in VPNs.
IPsec provides secure network communication.
Authentication Header (AH) (10 Marks)
Authentication Header provides authentication and integrity for IP packets.
Features
• Protects packet from modification
• Does not provide encryption
Example
Used where data confidentiality is not required.
AH ensures data integrity and authentication.
Encapsulating Security Payload (ESP) (10 Marks)
ESP provides confidentiality, authentication, and integrity.
Features
• Encrypts data
• Protects against replay attacks
Example
Used in VPN tunnels.
ESP is widely used for secure IP communication.
Combining Security Associations (10 Marks)
Security Associations (SA) define how IPsec protects traffic.
Types
• Transport mode
• Tunnel mode
Example
VPN uses multiple SAs for security.
Combining SAs increases security strength.
Key Management in IPsec (10 Marks)
Key management handles generation, distribution, and maintenance of keys.
Protocols
• IKE (Internet Key Exchange)
• ISAKMP
Example
Automatic key exchange in VPNs.
Key management ensures secure key handling.
Secure Socket Layer (SSL) and Transport Layer Security (TLS) (10 Marks)
SSL and TLS are protocols used to secure web communication.
Working
• Encrypts data between browser and server
• Uses certificates
Example
HTTPS websites.
TLS provides secure online transactions.
Secure Electronic Transaction (SET) (10 Marks)
SET is a protocol designed to secure online credit card payments.
Features
• Confidentiality
• Authentication
• Integrity
Example
Online shopping payment systems.
SET ensures safe electronic transactions.
Intruders (10 Marks)
Intruders are unauthorized users who try to access or damage systems.
Types
• Masquerader
• Misfeasor
• Clandestine user
Example
Hackers breaking into systems.
Intruders cause serious security threats.
Viruses (10 Marks)
A virus is a malicious program that infects files and systems.
Effects
• Data loss
• System crash
Example
Email attachment virus.
Viruses damage system integrity and performance.
Firewall Design Principles (10 Marks)
A firewall is a security device that controls network traffic.
Principles
• All traffic must pass through firewall
• Only authorized traffic allowed
• Firewall must be secure
Example
Network firewall in organizations.
Firewalls protect networks from external attacks.
Trusted Systems (10 Marks)
Trusted systems are computer systems that enforce security policies correctly.
Features
• Access control
• Authentication
• Audit mechanisms
Example
Secure government systems.
Trusted systems ensure high level of security.
Final Exam Tip
For 10 marks answers, always write:
• Definition
• Explanation / working
• Example
• Advantages / importance