B.E./B.Tech. Cryptography Answer Key 2025
B.E./B.Tech. Cryptography Answer Key 2025
(PART A – 2 Marks)
Common To all
Course Code 19CS415 Course Name CRYPTOGRAPHY
UNIT - I
Q. No. Questions
What is a key ethical consideration for a security professional when handling sensitive data?
● Prioritize privacy by ensuring data confidentiality and minimizing unauthorized access.
● Adhere to data protection laws like GDPR and HIPAA.
*QA101
● Limit data use to its intended purpose to avoid misuse.
● Maintain integrity and accuracy of sensitive information.
● Practice transparency with data usage policies and obtain consent where necessary.
Identify the main types of classical encryption techniques used in data security.
The main types of classical encryption techniques in data security include:
*QA102 Substitution Ciphers (e.g., Caesar Cipher,Playfair cipher,Polyalphabetic ciphers, One Time Pad Cipher, and Vigenère Cipher).
Transposition Ciphers (e.g., Rail Fence Cipher, Columnar Transposition). These methods manipulate plaintext by substituting or
rearranging characters, providing basic encryption before modern cryptographic algorithms like AES and RSA emerged.
Classify the different types of network security models.
In cryptography, network security models can be classified into the following types:
1. Symmetric Key Model – Uses a single key for both encryption and decryption (e.g., AES, DES).
*QA103
2. Asymmetric Key Model – Uses a public-private key pair for secure communication (e.g., RSA, ECC).
3. Hybrid Cryptographic Model – Combines symmetric and asymmetric encryption for efficiency (e.g., TLS, SSL).
4. End-to-End Encryption Model – Ensures data remains encrypted throughout transmission (e.g., Signal Protocol).
Compute the given Text “CRYPTOGRAPHY” into cipher text using Rail fence Technique. Key=3
*QA105
Step 2: Read Row-wise to Form Cipher Text
● First row: C T R H
● Second row: R P O R A H
● Third row: Y G P Y
Justify the need for implementing security measures at both the hardware and software levels.
Implementing security at both hardware and software levels ensures comprehensive protection against cyber threats. Hardware security
*QA106 (e.g., TPM, biometric authentication) prevents physical attacks, while software security (e.g., firewalls, encryption) defends against
malware and breaches. Combining both strengthens data integrity, confidentiality, and system resilience against evolving security threats.
Generate a Caesar Cipher encryption for the message "HELLO" with a shift of 3.
To encrypt "HELLO" using the Caesar Cipher with a shift of 3, we shift each letter forward by 3 places in the alphabet.
● H→K
*QA107 ● E→H
● L→O
● L→O
● O→R
UNIT - II
Q. No. Questions
*QA204
Find the Hamming weight of the binary number 10110101.
The Hamming weight of a binary number is the number of 1s in the sequence.
For 10110101, we count the 1s:
*QA205 1 0 1 1 0 1 0 1 → Total = 5
Final Answer:
Hamming weight of 10110101 = 5
*QA207
Apply the concept of determinism in pseudorandom number generation by showing how a fixed seed produces the same sequence
of numbers.
QA208 In pseudorandom number generation, determinism means that a fixed seed value initiates the generator to produce the same sequence
each time it’s used. For example, a generator seeded with “123” will always output the same number series, like 5, 9, 3..., enabling
reproducibility in simulations and testing while appearing random.
UNIT - III
Q. No. Questions
Why is asymmetric cryptography bad for huge data? Specify the reason.
Asymmetric cryptography is inefficient for huge data due to its high computational cost. Operations like modular exponentiation in
*QA304
RSA or elliptic curve computations require significant processing power. Additionally, asymmetric encryption is slower than
symmetric encryption, making it impractical for encrypting large datasets, where symmetric algorithms like AES are preferred.
*QA305
*QA307
Identify one major weakness associated with the RC4 stream cipher.
A major weakness of the RC4 stream cipher is its biased output, especially in the initial keystream bytes. The first bytes leak information
*QA308
about the key, making it vulnerable to cryptanalysis. This flaw enables attacks like RC4 bias attacks and key recovery attacks,
compromising security in protocols like WEP and TLS.
UNIT - IV
Q. No. Questions
Analyze the security implications of using the Diffie-Hellman key exchange without authentication.
Using the Diffie-Hellman key exchange without authentication introduces significant security risks, primarily:
1. Man-in-the-Middle (MITM) Attacks – An attacker can intercept and establish separate keys with both parties, decrypting and
re-encrypting messages unnoticed.
*QA404
2. Lack of Identity Verification – No guarantee that communication is with the intended recipient, allowing impersonation.
3. Susceptibility to Active Attacks – Without authentication, attackers can manipulate key exchange parameters, compromising
security.
4. Vulnerability to Logjam Attack – Weak parameters can enable adversaries to break encryption using precomputed values.
Perform encryption using RSA Algorithm for the following:P=7; q=11; e=17; M=8.
Soln:
n = pq
n = 7*11=77
φ (n) = (p - 1) x (q-1)
*QA406
=6*10 = 60
e =17
C = Me mod n
C = 817 mod 77
C = 57
What is a Public Key Infrastructure and why is it important for secure communications?
Public Key Infrastructure (PKI) is a framework that manages digital keys and certificates for secure communications. It ensures
*QA408
authentication, confidentiality, and integrity using encryption and digital signatures. PKI prevents unauthorized access, supports secure
data exchange, and enables trust in online transactions by verifying identities through trusted Certificate Authorities (CAs).
UNIT - V
Q. No. Questions
Analyze the security strengths and weaknesses of biometric authentication compared to password-based authentication.
*QA503
Justify the use of Challenge-Response Protocol in preventing replay attacks.
The Challenge-Response Protocol prevents replay attacks by using a unique, random challenge for each authentication attempt. The
*QA504
responder must compute a valid response using a secret key, ensuring old responses cannot be reused. Since each session has a fresh
challenge, attackers cannot replay intercepted authentication messages successfully.
Name the different types of Secure Hash Algorithms used in cryptographic applications.
The different types of Secure Hash Algorithms (SHA) used in cryptographic applications include:
1. SHA-1 – 160-bit hash, now deprecated due to vulnerabilities.
*QA507
2. SHA-2 – Includes SHA-224, SHA-256, SHA-384, SHA-512, offering stronger security.
3. SHA-3 – A newer family with SHA3-224, SHA3-256, SHA3-384, SHA3-512, based on the Keccak algorithm.
4. SHAKE (SHA-3 Extendable-Output Functions) – SHAKE-128, SHAKE-256, for variable-length output.
UNIT - I
Q. No. Questions
Apply the following substitution techniques:
(i) Caesar Cipher:
Plain text: “hello how are
you” ( shift 4 )
The Caesar Cipher is a simple shift cipher where each letter in the plaintext is shifted forward by a fixed number of places (here, 4).
The alphabet used is:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
A shift of 4 means:
*QB101(a)
A → E, B → F, C → G, ..., X → B, Y → C, Z → D
h→l
e→i
l→p
l→p
o→s
h→l
o→s
w→a
a→e
r→v
e→i
y→c
o→s
u→y
The One-Time Pad (OTP) is an unbreakable cipher if used correctly. It works by adding each letter of the plaintext to a key letter using
modular addition (mod 26).
A = 0, B = 1, C = 2, ..., Z = 25
Plaintext: TODAYHOLIDAY
Key: NCBTUQMOFHAI
Step 3: Convert Back to Letters
Final Ciphertext:
"GQETSXAANKAG"
Convert “MEET ME” using Hill cipher with the key matrix
Solution:
The Hill Cipher is a polygraphic substitution cipher that uses matrix multiplication over mod 26 arithmetic.
Since we are given a 3×3 key matrix, we split the plaintext into two groups of 3-letter blocks:
Since 25 and 26 are not coprime, we check for an alternative approach. However, to continue solving, let's assume that an inverse
matrix exists (precomputed as):
Step 3: Convert Ciphertext to Numeric Form
Ciphertext: "GREBZI"
Implementing security measures at multiple levels within an organization, often called "defense-in-depth," is crucial because it creates
a layered approach, making it significantly harder for attackers to breach sensitive data by forcing them to bypass multiple security
barriers, even if one layer is compromised; essentially, if one security measure fails, others are still in place to protect against threats.
Multi-layered security refers to securing your organization's data using a variety of security measures. The idea is that if hackers want
to access the data, they have to break through multiple layers of security (e.g., physical, administrative, and technical), making it much
more difficult to gain access.
Physical Security:
1. Access control systems: Controlling entry to restricted areas with keycards, biometrics, or door locks.
2. Surveillance cameras: Monitoring physical spaces to detect suspicious activity.
3. Secure data storage: Protecting physical devices containing sensitive data with locked cabinets or specialized storage solutions.
Physical security is important for businesses because it helps protect against financial losses and reputational damage. It also helps
keep employees safe and secure at work. And four main types of physical security: deter, detect, delay, and respond. Implementing
these 4 types of physical security will help you protect your business from potential physical attacks.
Network Security:
Network security refers to measures taken to protect a computer network from unauthorized access, attacks, or misuse. It
involves firewalls, intrusion detection systems, and virtual private networks to secure the network infrastructure. Network
security focuses on securing the network infrastructure rather than the data itself. Network security is primarily concerned with
preventing unauthorized access to the network and protecting the network from attacks and threats.
1. Firewalls: Filtering incoming and outgoing network traffic to block unauthorized access.
2. Intrusion Detection/Prevention Systems (IDS/IPS): Monitoring network activity for malicious behavior and actively blocking
potential threats.
3. Network segmentation: Dividing the network into smaller, isolated segments to limit the spread of attacks.
4. Virtual Private Networks (VPNs): Securely encrypting data transmitted over public networks for remote access.
Application Security:
Application security (AppSec) is the process of identifying and fixing vulnerabilities in applications to prevent unauthorized access,
modification, or misuse. It involves a variety of tools and methodologies, and can occur at different stages of the software development
life cycle (SDLC).
Application security aims to protect software application code and data against cyber threats. You can and should apply application
security during all phases of development, including design, development, and deployment.
Here are several ways to promote application security throughout the software development lifecycle (SDLC):
1. Introduce security standards and tools during design and application development phases. For example, include vulnerability
scanning during early development.
2. Implement security procedures and systems to protect applications in production environments. For example, perform
continuous security testing.
3. Implement strong authentication for applications that contain sensitive data or are mission critical.
4. Use security systems such as firewalls, web application firewalls (WAF), and intrusion prevention systems (IPS).
● Input validation: Checking user input for malicious characters to prevent injection attacks.
● Secure coding practices: Writing code with security considerations in mind to mitigate vulnerabilities.
● Web application firewall (WAF): Filtering web traffic to protect against web application attacks.
1. Strong passwords: Enforcing complex password policies with length and character variety requirements.
2. Multi-factor authentication (MFA): Requiring additional verification methods (like a code sent to a phone) beyond just a
password for logins.
3. Least privilege principle: Granting users only the minimum access level needed to perform their job functions.
Endpoint Security:
Overall, a multi-layered security approach is considered the most effective way to protect an organization's sensitive data and systems
by providing a comprehensive defense against a wide range of cyber threats.
(Or)
Explain the basic components of a network security model and their functions in protecting data integrity and confidentiality.
Network security is a multi-faceted approach to protecting the integrity, confidentiality, and availability of information and resources
on a network. This model is fundamental to ensure that unauthorized access, misuse, and attacks are minimized or prevented altogether.
*QB102
(b)
2.1. Firewalls
Firewalls act as the first line of defense against unauthorized access to networked resources. A firewall monitors and controls incoming
and outgoing network traffic based on predetermined security rules. They can be hardware-based, software-based, or a combination of
both.
Packet Filtering Firewalls: Examine packets at the network layer and enlighten network communications by allowing or blocking data
based on IP addresses, ports, and protocols.
Stateful Inspection Firewalls: Track active connections and determine which packets are legitimate by maintaining a state table.
Next-Generation Firewalls (NGFWs): Incorporate advanced features like application awareness, intrusion prevention systems (IPS),
and deep packet inspection (DPI).
IDPS are crucial for monitoring network traffic for suspicious activities and potential threats. They can identify and take action against
malicious activities within the network.
Intrusion Detection Systems (IDS): These tools sit on the network to monitor for signs of intrusion and alert administrators if an attack
occurs.
Intrusion Prevention Systems (IPS): IPS not only detect threats but also take preventive measures, often configured to block or reject
offensive packets automatically.
VPNs provide a secure tunnel for remote access to a network. They encrypt the data that travels between the user and the network,
ensuring confidentiality and integrity.
Remote Access VPN: Enables individual employees to connect to a corporate network securely from remote locations.
Site-to-Site VPN: Connects entire networks to each other, ideal for business offices spread across multiple geographical locations.
Authentication: Verifying the identity of users before granting access to the network. This includes:
Two-factor authentication: Combines something the user knows (password) with something they have (a smartphone app or token).
Biometric authentication: Uses physical characteristics such as fingerprints or facial recognition.
Authorization: Determines what an authenticated user can do. This often involves assigning roles and permissions based on the
principle of least privilege.
2.5. Encryption
Encryption is the process of converting data into a code to prevent unauthorized access. It is essential for protecting sensitive
information in transit and at rest.
Data in Transit Encryption: Ensures that data traveling over the network is secure, mainly applied in protocols like SSL/TLS for web
traffic.
Data at Rest Encryption: Protects stored data on devices and databases, commonly employing encryption standards like AES (Advanced
Encryption Standard).
Antivirus and antimalware software are critical in combating malicious software, including worms, viruses, trojans, and ransomware.
Sandboxing: Allows files to be executed in a controlled environment to observe their behavior before deployment.
SIEM solutions provide real-time analysis of security alerts generated by hardware and applications in the network. SIEM consolidates
log and event data for analysis.
Log Management: Collects and maintains logs from various devices in the network.
Correlation: Analyzes the data for patterns that indicate security incidents.
Alerting: Notifies administrators for immediate action based on predefined rules.
Network segmentation involves dividing a network into smaller, manageable segments or subnets. This practice enhances security by
isolating sensitive data and controlling traffic flow between segments.
Physical Segmentation: Using separate physical devices (like routers and switches) to isolate networks.
Virtual Segmentation: Using VLANs (Virtual Local Area Networks) to create distinct network segments on the same physical
infrastructure.
Network security components play a critical role in ensuring data integrity (protection from unauthorized modification) and
confidentiality (protection from unauthorized access). Below is an overview of how key security components contribute to these
objectives:
1. Firewalls
Firewalls act as the first line of defense by filtering incoming and outgoing traffic based on security policies. Packet filtering firewalls
block suspicious IPs, stateful inspection firewalls track active connections, and next-generation firewalls (NGFWs) provide deep
packet inspection and intrusion prevention. This prevents unauthorized access and potential data manipulation.
IDS monitors network traffic for anomalies, while IPS actively blocks malicious activities. By identifying and mitigating threats like
malware, hacking attempts, and unauthorized modifications, these systems help maintain data integrity and confidentiality.
VPNs encrypt communication channels, ensuring that data remains private even when transmitted over unsecured networks. Remote
access VPNs protect employees working remotely, while site-to-site VPNs secure inter-office communications, preventing
eavesdropping and data breaches.
Authentication mechanisms like multi-factor authentication (MFA) and biometric verification ensure only authorized users access
sensitive data. Role-based authorization enforces the principle of least privilege, restricting access to essential resources.
5. Encryption
Encryption transforms sensitive data into an unreadable format using algorithms like AES and SSL/TLS, protecting both data at rest
(stored information) and data in transit (network communication).
These tools detect and remove threats such as ransomware, viruses, and Trojans, preventing unauthorized alterations and leaks.
SIEM systems collect and analyze security logs, identifying threats before they compromise data integrity or confidentiality.
8. Network Segmentation
By dividing networks into segments (e.g., VLANs), critical assets remain isolated, limiting an attacker's ability to move laterally within
a network.
Discuss the concept of steganography, outline its types, and provide diagrams and examples to illustrate its applications.
Steganography is the practice of hiding information in another message or physical object so that it's not obvious. It's a form of covert
communication that can be used to conceal almost any type of digital content, including text, images, videos, and audio.
1. Hidden data: It hides information inside another file (like an image or audio) so that it is not noticeable.
2. Least Significant Bit (LSB) method: Small changes are made to the least important parts of a file (like pixels in an image) to
hide the secret data.
3. Large capacity: You can hide a lot of information in big files.
4. Various media: It works with images, audio, video, and text.
5. Extra security: It becomes more secure when used with encryption.
6. Durability: Hidden data can survive compression or slight changes to the file.
7. Hard to detect: Advanced methods make it difficult to find hidden information.
*QB103
(a)
Types of steganography:
● Text steganography: Hiding a secret message in a piece of text
● Image steganography: Encoding a secret message in a digital image
● Video steganography: Encoding an entire video
● Audio steganography: Hiding information in an audio file
● Network steganography: Hiding information in network traffic
Steganography is different from cryptography because it doesn't use a key or scramble data. Instead, it's a way of hiding data in clever
ways.
1. Text Steganography − There is steganography in text files, which entails secretly storing
information. In this method, the hidden data is encoded into the letter of each word.
2. Image Steganography − The second type of steganography is image steganography, which entails
concealing data by using an image of a different object as a cover. Pixel intensities are the key
to data concealment in image [Link] the computer description of an image contains
multiple bits, images are frequently used as a cover source in digital steganography.
3. Audio Steganography − It is the science of hiding data in sound. Used digitally, it protects against
unauthorized reproduction. Watermarking is a technique that encrypts one piece of data (the
message) within another (the "carrier"). Its typical uses involve media playback, primarily audio
clips.
4. Video Steganography − Video steganography is a method of secretly embedding data or other files
within a video file on a computer. Video (a collection of still images) can function as the "carrier"
in this scheme. Discrete cosine transform (DCT) is commonly used to insert values that can be
used to hide the data in each image in the video, which is undetectable to the naked eye. Video
steganography typically employs the following file formats: H.264, MP4, MPEG, and AVI.
5. Network or Protocol Steganography − It involves concealing data by using a network protocol like TCP,
UDP, ICMP, IP, etc., as a cover object. Steganography can be used in the case of covert channels,
which occur in the OSI layer network model.
Steganography has a huge advantage over standard cryptographic methods. When someone uses cryptography, they’re passively calling
attention to the fact that there’s secret information present in the medium in question. Thus, the very presence of encrypted data tells
intruders, “Aha! Here’s some secret information!” Steganography, however, hides the sensitive information in an otherwise innocuous
document. Therefore, would-be hackers have no idea that there is anything secret and enticing in the first place.
Steganography Techniques:
Now that we have a better grasp on what steganography is, what forms it comes in, and who uses it, let’s take a closer look at a sample
of the available techniques.
Examples of steganography:
1. Invisible ink: Writing a secret message in between the lines of a letter
2. Embedding text in an image: An artist might hide their initials in a painting
3. Backward masking: Recording a secret message backward on an audio file
4. Hiding an image in a video: The image is only visible if the video is played at a specific frame rate.
5. Using a puzzle: Encoding a secret message within a puzzle, such as a Sudoku puzzle
(Or)
Explain in detail about OSI Security Architecture with suitable diagrams and examples.
The OSI (Open Systems Interconnection) Security Architecture defines a systematic approach to providing security at each layer. It
defines security services and security mechanisms that can be used at each of the seven layers of the OSI model to provide security for
data transmitted over a network.
These security services and mechanisms help to ensure the confidentiality, integrity, and availability of the data. OSI architecture is
internationally acceptable as it lays the flow of providing safety in an organization. OSI Security Architecture focuses on these concepts:
1. Security Attack
2. Security mechanism
3. Security Service
*QB103
(b)
1. Security Attacks
A security attack is an attempt by a person or entity to gain unauthorized access to disrupt or compromise the security of a system,
network, or device. These are defined as the actions that put at risk an organization’s safety. They are further classified into 2 sub-
categories:
Passive Attack: Attacks in which a third-party intruder tries to access the message/ content/ data being shared by the sender and
receiver by keeping a close watch on the transmission or eave-dropping the transmission is called Passive Attacks. These types of
attacks involve the attacker observing or monitoring system, network, or device activity without actively disrupting or altering it.
Passive attacks are typically focused on gathering information or intelligence, rather than causing damage or disruption. Here, both the
sender and receiver have no clue that their message/ data is accessible to some third-party intruder. The message/ data transmitted
remains in its usual form without any deviation from its usual behavior. This makes passive attacks very risky as there is no information
provided about the attack happening in the communication process. Passive attacks are further divided into two parts based on their
behavior:
Eavesdropping: Eavesdropping involves the attacker intercepting and listening to communications between two or more parties
without their knowledge or consent. Eavesdropping can be performed using a variety of techniques, such as packet sniffing, or man-
in-the-middle attacks.
Traffic analysis: This involves the attacker analyzing network traffic patterns and metadata to gather information about the system,
network, or device. Here the intruder can’t read the message but only understand the pattern and length of encryption. Traffic analysis
can be performed using a variety of techniques, such as network flow analysis, or protocol analysis.
Active Attacks: Active attacks refer to types of attacks that involve the attacker actively disrupting or altering system, network, or
device activity. Active attacks are typically focused on causing damage or disruption, rather than gathering information or intelligence.
Here, both the sender and receiver have no clue that their message/ data is modified by some third-party intruder. The message/ data
transmitted doesn’t remain in its usual form and shows deviation from its usual behavior. This makes active attacks dangerous as there
is no information provided of the attack happening in the communication process and the receiver is not aware that the data/ message
received is not from the sender. Active attacks are further divided into four parts based on their behavior:
Masquerade: Masquerade is a type of attack in which the attacker pretends to be an authentic sender in order to gain unauthorized
access to a system. This type of attack can involve the attacker using stolen or forged credentials, or manipulating authentication or
authorization controls in some other way.
Replay: Replay is a type of active attack in which the attacker intercepts a transmitted message through a passive channel and then
maliciously or fraudulently replays or delays it at a later time.
Modification of Message: Modification of Message involves the attacker modifying the transmitted message and making the final
message received by the receiver look like it’s not safe or non-meaningful. This type of attack can be used to manipulate the content
of the message or to disrupt the communication process.
Denial of service (DoS): Denial of Service attacks involve the attacker sending a large volume of traffic to a system, network, or device
in an attempt to overwhelm it and make it unavailable to users.
2. Security Mechanism
The mechanism that is built to identify any breach of security or attack on the organization, is called a security mechanism. Security
Mechanisms are also responsible for protecting a system, network, or device against unauthorized access, tampering, or other security
threats.
Encipherment (Encryption): Encryption involves the use of algorithms to transform data into a form that can only be read by someone
with the appropriate decryption key. Encryption can be used to protect data it is transmitted over a network, or to protect data when it
is stored on a device.
Digital signature: Digital Signature is a security mechanism that involves the use of cryptographic techniques to create a unique,
verifiable identifier for a digital document or message, which can be used to ensure the authenticity and integrity of the document or
message.
Traffic padding: Traffic Padding is a technique used to add extra data to a network traffic stream in an attempt to obscure the true
content of the traffic and make it more difficult to analyze.
Routing control: Routing Control allows the selection of specific physically secure routes for specific data transmission and enables
routing changes, particularly when a gap in security is suspected.
3. Security Services
Security services refer to the different services available for maintaining the security and safety of an organization. They help in
preventing any potential risks to security. Security services are divided into 5 types:
Authentication: Authentication is the process of verifying the identity of a user or device in order to grant or deny access to a system
or device.
Access control: Access Control involves the use of policies and procedures to determine who is allowed to access specific resources
within a system.
Data Confidentiality: Data Confidentiality is responsible for the protection of information from being accessed or disclosed to
unauthorized parties.
Data integrity: Data Integrity is a security mechanism that involves the use of techniques to ensure that data has not been tampered
with or altered in any way during transmission or storage.
Non- repudiation: Non-repudiation involves the use of techniques to create a verifiable record of the origin and transmission of a
message, which can be used to prevent the sender from denying that they sent the message.
Providing Security: OSI Architecture in an organization provides the needed security and safety, preventing potential threats and
risks.
Organising Task: The OSI architecture makes it easy for managers to build a security model for the organization based on strong
security principles.
Meets International Standards: Security services are defined and recognized internationally meeting international standards.
Interoperability: By dividing network functions into multiple levels, the OSI model makes it easier for different hardware and software
components to work together.
Scalability: The layered method makes networks scalable. New technologies and protocols can be seamlessly added without
interrupting the overall system.
Flexibility: Each layer can evolve separately, providing flexibility for technology and application changes.
Conclusion
In conclusion, the OSI Security Architecture provides an important framework for protecting organizational data and communication
activities. Security measures are classified into attacks, mechanisms, and services, providing an integrated approach to assuring
confidentiality, integrity, and availability. This internationally recognized architecture not only improves security, but also encourages
task organization, interoperability, scalability, and flexibility in network contexts.
(Or)
Differentiate between symmetric and asymmetric key encryption with suitable diagrams and examples.
Symmetric key:
Symmetric key encryption uses a single "secret" key to both encrypt and decrypt data, meaning both sender and receiver need to know
the same key, while asymmetric key encryption uses a pair of keys: a public key for encryption and a private key for decryption,
allowing anyone to encrypt data but only the intended recipient to decrypt it using their private key; essentially, symmetric encryption
is like sharing a single lock and key, while asymmetric encryption is like having a public mailbox (public key) where anyone can put
a letter, but only the owner with the matching key (private key) can open it.
*QB104
(a)
How it works:
● The sender uses the shared secret key to encrypt the plaintext message, transforming it into ciphertext.
● The encrypted message is sent to the receiver.
● The receiver uses the same shared secret key to decrypt the ciphertext, recovering the original plaintext.
Example:
Two friends, Alice and Bob, want to send secret messages to each other. They agree on a single password (the secret key) that both
know. Alice uses the password to encrypt her message, and Bob uses the same password to decrypt it when he receives it.
How it works:
● Each user has a pair of keys: a public key that can be shared with anyone, and a private key that must be kept secret.
● When Alice wants to send a secure message to Bob, she uses Bob's public key to encrypt the message.
● Only Bob can decrypt the message using his corresponding private key.
Example:
When you log in to an online banking website, you use your username and password to access your public key, which is then used to
encrypt the sensitive information you send to the bank's servers. Only the bank's private key can decrypt this data.
Key Differences:
1. Key Distribution: Symmetric encryption requires a secure way to share the secret key between parties, while asymmetric
encryption does not need to exchange the private key as it is kept secret by the owner.
2. Speed: Symmetric encryption is generally faster for encrypting large amounts of data because it only uses one key.
3. Security: Asymmetric encryption is considered more secure for key exchange and digital signatures due to the separation of
public and private keys.
1. Symmetric Encryption: Secure communication between two parties who need fast encryption of large amounts of data, like
in instant messaging apps.
2. Asymmetric Encryption: Securely exchanging sensitive information like passwords or digital signatures, where the sender
needs to verify their identity.
Symmetric Key Encryption: Encryption is a process to change the form of any message in order to protect it from reading by anyone.
In Symmetric-key encryption the message is encrypted by using a key and the same key is used to decrypt the message which makes
it easy to use but less secure. It also requires a safe method to transfer the key from one party to another.
Asymmetric Key Encryption: Asymmetric Key Encryption is based on public and private key encryption techniques. It uses two
different key to encrypt and decrypt the message. It is more secure than the symmetric key encryption technique but is much slower.
(Or)
Illustrate how the One-Time Pad cipher achieves perfect security, using an example to support your explanation.
Mathematical Explanation
Given a plaintext message P and a randomly generated key K, the ciphertext C is calculated using:
*QB104(b)
Since K is completely random, every possible plaintext is equally probable, making it impossible to determine the original
message without knowing K.
Let's assign binary values to each letter (using 5-bit ASCII representations):
H (72) 10010
E (69) 10100
L (76) 11000
L (76) 11000
O (79) 11011
The key must be the same length as the plaintext and completely random:
1. Truly Random Key: Since K is completely random and used only once, every possible plaintext is equally probable.
2. Key Length Equals Message Length: There is no pattern in K, preventing cryptanalysis.
3. Unbreakability: Without knowing K, an attacker cannot infer P, making OTP unbreakable even with infinite computational
power.
Limitation: The OTP requires a secure way to distribute and store the key, making it impractical for large-scale communication.
UNIT - II
Q. No. Questions
Apply the fundamental concepts of information theory to evaluate the efficiency of data transmission.
To evaluate the efficiency of data transmission using the fundamental concepts of information theory, we need to delve into several
key areas: entropy, channel capacity, and data encoding.
1. Entropy
Entropy is a fundamental measure in information theory that quantifies the amount of uncertainty or unpredictability in a set of data.
Introduced by Claude Shannon, entropy provides a measure of the average amount of information produced by a stochastic source of
data.
● Definition: Mathematically, entropy H(X) of a random variable X with possible outcomes {x1,x2,...,xn} and probabilities
{p1,p2,...,pn} is defined as:
*QB201 (a) Interpretation: Entropy measures the average number of bits needed to encode each symbol from the source. Higher entropy indicates
more unpredictability and thus requires more bits for encoding.
Example: If a source produces symbols with equal probability, the entropy is maximized. For a binary source with symbols '0' and '1'
each with probability 0.5, the entropy is:
In contrast, if a source always produces the same symbol, the entropy is 0, indicating no uncertainty or additional information per
symbol.
2. Channel Capacity
Channel capacity is the maximum rate at which information can be reliably transmitted over a communication channel. This concept
is crucial for evaluating the efficiency of data transmission systems.
● Definition: The capacity CCC of a channel with a given signal-to-noise ratio (SNR) is given by Shannon’s capacity formula:
● where SNR is the ratio of the signal power to the noise power.
● Interpretation: Channel capacity represents the upper bound of the achievable data rate, taking into account the noise and
interference affecting the transmission. Efficient data transmission means operating close to this capacity.
Example: For a channel with an SNR of 15 dB (which is 10 times the power ratio), the capacity is:
3. Data Encoding
Data encoding refers to the methods used to represent data in a form suitable for transmission over a channel. Efficient encoding
minimizes redundancy and maximizes the utilization of the available channel capacity.
● Lossless Compression: This technique ensures that the original data can be perfectly reconstructed from the compressed data.
Algorithms like Huffman coding and arithmetic coding are examples. These methods leverage the entropy of the source to
reduce the average number of bits needed per symbol.
● Error-Detecting and Error-Correcting Codes: To ensure reliable transmission despite noise, encoding schemes often
include redundancy for error detection and correction. For example, Hamming codes and Reed-Solomon codes can detect and
correct errors, thereby improving the robustness of the transmission but at the cost of additional bits.
Example: Huffman coding assigns shorter codes to more frequent symbols and longer codes to less frequent ones, based on the
symbol’s probability distribution. This method aims to approach the entropy limit of the source.
3. Error Rate and Redundancy: The performance of error-correcting codes can be evaluated by the bit error rate (BER) and the
redundancy introduced. The trade-off between redundancy for error correction and the data rate is critical in assessing overall
efficiency.
Example: Suppose a communication system has a channel capacity of 10 Mbps but operates at a data rate of 7 Mbps. The
channel utilization is:
Hence, the efficiency of data transmission can be evaluated by understanding and applying the fundamental concepts of information
theory:
● Entropy provides insights into the optimal encoding length required for a given source.
● Channel Capacity sets the theoretical maximum for data transmission rates, which can be approached but not exceeded.
● Data Encoding methods balance the need for efficient data representation with error resilience and redundancy.
By analyzing these aspects, one can gauge how effectively a communication system utilizes its resources and adheres to
theoretical limits. Ultimately, achieving high efficiency involves minimizing redundancy, maximizing data rates, and
maintaining reliability in the face of noise and interference.
(Or)
Describe Claude Shannon’s channel capacity theorem in information theory and highlight its importance in communication systems.
Shannon theorem dictates the maximum data rate at which the information can be transmitted over a noisy band-limited channel.
The maximum data rate is designated as channel capacity. The concept of channel capacity is discussed first, followed by an in-depth
*QB201 (b) treatment of Shannon’s capacity for various channels. In 1948, the Information theory by Claude E. Shannon was proposed.
Introduction
The main goal of a communication system design is to satisfy one or more of the following objectives.
● The transmitted signal should occupy smallest bandwidth in the allocated spectrum – measured in terms of bandwidth efficiency
also called as spectral efficiency – ηB.
● The designed system should be able to reliably send information at the lowest practical power level. This is measured in terms of
power efficiency – ηP.
● Ability to transfer data at higher rates – R bits=second.
● The designed system should be robust to multipath effects and fading.
● The system should guard against interference from other sources operating in the same frequency – low carrier-to-cochannel signal
interference ratio (CCI).
● Low adjacent channel interference from near by channels – measured in terms of adjacent channel Power ratio (ACPR).
● Easier to implement and lower operational costs.
It provides a precise limit on the maximum rate at which information can be transmitted over a communication channel while still
allowing for error-free reception. This theorem is pivotal for designing and optimizing communication systems.
It was widely believed that the only way for reliable communication over a noisy channel is to reduce the error probability as small as
possible, which in turn is achieved by reducing the data rate. However, the rate is limited by a maximum rate called the channel
capacity. If one attempts to send data at rates above the channel capacity, it will be impossible to recover it from errors.
This is called Shannon’s noisy channel coding theorem and it can be summarized as follows:
● A given communication system has a maximum rate of information – C, known as the channel capacity.
● If the transmission information rate R is less than C, then the data transmission in the presence of noise can be made to happen with
arbitrarily small error probabilities by using intelligent coding techniques.
● To get lower error probabilities, the encoder has to work on longer blocks of signal data. This entails longer delays and higher
computational requirements.
The theorem indicates that with sufficiently advanced coding techniques, transmission that nears the maximum channel capacity – is
possible with arbitrarily small errors. One can intuitively reason that, for a given communication system, as the information rate
increases, the number of errors per second will also increase.
Shannon’s noisy channel coding theorem is a generic framework that can be applied to specific scenarios of communication.
Importance of Shannon’s Channel Capacity Theorem in Communication Systems:
Shannon’s theorem has profound implications for communication systems, guiding the design, optimization, and evaluation of various
aspects of these systems.
1. Determining Maximum Data Rates
One of the most significant impacts of the theorem is its ability to determine the maximum achievable data rate, or capacity, of a
channel given its bandwidth and noise characteristics. This provides a theoretical upper bound on how much information can be
transmitted reliably.
● Implications for Design: Knowing the channel capacity allows engineers to design systems that approach this limit. For
instance, in designing wireless communication systems, engineers use the capacity formula to determine the maximum data
rate that can be supported under given conditions and then design coding and modulation schemes to approach this limit.
2. Guiding Modulation and Coding Techniques
The theorem influences the development of modulation and coding schemes, which are essential for effective communication.
● Modulation: Shannon’s formula shows that increasing the bandwidth or the signal-to-noise ratio can increase the channel
capacity. Thus, modulation schemes must be designed to make efficient use of available bandwidth and signal power.
● Error-Correcting Codes: Shannon also showed that error-correcting codes could be used to approach the channel capacity.
By adding redundancy to the transmitted information, these codes enable reliable transmission at rates close to the channel
capacity, effectively managing the trade-off between redundancy and data rate.
3. Impact on Communication System Efficiency
The capacity theorem helps in evaluating the efficiency of communication systems.
● Bandwidth Efficiency: This is calculated by dividing the data rate by the bandwidth. Shannon’s theorem helps to understand
how efficiently the system uses the available bandwidth and whether the current system design is close to the theoretical limits.
● Power Efficiency: By using the channel capacity formula, engineers can assess how power-efficient a communication system
is and make decisions about power allocation to achieve desired performance levels.
4. Design Trade-offs
Understanding channel capacity aids in making informed design trade-offs between various system parameters:
● Bandwidth vs. Power: For a given capacity, increasing bandwidth can allow for a lower signal-to-noise ratio, while increasing
signal power can improve capacity without expanding bandwidth. This trade-off is crucial in both wired and wireless
communication system designs.
● Reliability vs. Data Rate: The theorem indicates that to achieve higher data rates, one might need to tolerate a higher error
rate or use more complex coding schemes to maintain reliability. This balance is crucial for system performance and user
experience.
5. Applications in Modern Communication Technologies
Shannon’s theorem is foundational for many modern communication technologies, including:
● Wireless Networks: In cellular and Wi-Fi networks, understanding channel capacity helps in designing efficient frequency
reuse schemes, optimizing network coverage, and managing interference.
● Data Compression: Although Shannon’s theorem primarily addresses transmission rates, the concept of entropy also applies
to data compression. Efficient data compression algorithms are designed to approach the entropy limit of the source, making
use of the insights from Shannon’s work.
● Satellite Communications: Satellite communication systems utilize the channel capacity concept to maximize data
transmission rates while managing bandwidth and power constraints.
Analyze how information theory principles are applied in data compression algorithms and discuss their impact on efficiency and
performance.
*QB202 (a)
Information theory principles are integral to the design and functioning of data compression algorithms. These principles, such as
entropy and redundancy, guide how data can be represented more efficiently. A detailed analysis of how these principles are applied
in data compression algorithms and their impact on efficiency and performance are given below.
Redundancy: Redundancy is the difference between the maximum possible entropy (if each symbol were equally likely) and the
actual entropy of the data. Compression algorithms aim to reduce this redundancy by using shorter codes for more frequent symbols
and longer codes for less frequent ones.
2. Huffman Coding
● Principle: Huffman coding is a lossless data compression algorithm that uses a variable-length prefix coding scheme where
more frequent symbols are assigned shorter codes, and less frequent symbols get longer codes. This approach reduces the
average length of the encoded message, approaching the entropy limit of the source.
● Algorithm: Huffman coding builds a binary tree of nodes, with each node representing a symbol and its frequency. The
algorithm creates the optimal prefix-free code by merging nodes with the lowest frequencies first, ensuring that the resultant
encoding is minimal in terms of average code length.
● Impact: Huffman coding can achieve compression ratios close to the entropy limit for the source, making it highly efficient
for data with a clear frequency distribution pattern. However, its efficiency decreases for data sources with highly uniform
symbol distributions or very low redundancy.
3. Arithmetic Coding
● Principle: Arithmetic coding is another lossless compression technique that encodes the entire message into a single number
in the range [0,1). Unlike Huffman coding, which assigns codes to individual symbols, arithmetic coding encodes the entire
sequence as a fraction of a range based on symbol probabilities.
● Algorithm: The algorithm divides the interval [0,1) into subintervals proportional to symbol probabilities. As each symbol is
processed, the interval is further subdivided according to the probabilities, resulting in a final interval that represents the entire
message. The resulting code is a single number from this interval.
● Impact: Arithmetic coding often achieves better compression ratios than Huffman coding, particularly for data with skewed
or irregular symbol distributions. It can approach the entropy limit more closely because it handles symbols as a sequence
rather than individually.
(Or)
Explain the principles of pseudorandom number generation, emphasizing the role of the seed and its impact on the generated number
sequence.
1. Deterministic Algorithms: PRNGs rely on algorithms that produce a sequence of numbers based on an initial value called the
seed. Given the same seed, a PRNG will always generate the same sequence of numbers. This determinism is essential for
applications requiring reproducibility, such as simulations or testing.
2. Mathematical Functions: PRNGs utilize mathematical functions, often involving modular arithmetic, linear congruential
generators (LCGs), or more complex algorithms like Mersenne Twister or Cryptographically Secure Pseudorandom Number
Generators (CSPRNGs). These functions process the seed to produce a sequence of numbers that appear random.
3. Uniform Distribution: A good PRNG aims to produce numbers that are uniformly distributed over a specified range. This
means that every number within the range should have an equal probability of being generated. Uniformity is crucial for
applications in statistics, cryptography, and gaming.
4. Periodicity: PRNGs have a finite period, meaning that after a certain number of iterations, the sequence of numbers will repeat.
The period length varies depending on the algorithm used and should be long enough to ensure that the same sequence is not
repeated in practical applications.
5. Statistical Properties: Effective PRNGs exhibit properties akin to those of true random numbers, such as independence and
*QB202 (b)
unpredictability. Statistical tests are often conducted to evaluate these properties, ensuring the generated numbers do not exhibit
patterns or biases.
The seed is a critical component in the functioning of a PRNG. It serves as the initial input to the pseudorandom number generation
algorithm and directly influences the entire sequence of numbers produced. Here’s how the seed operates within the PRNG framework:
1. Initialization: The seed initializes the state of the PRNG. It can be any arbitrary value, but the choice of seed can significantly
impact the randomness of the generated sequence. A common practice is to use a source of entropy, such as the current time,
system states, or user inputs, to ensure varied seeds across different runs.
2. Influence on Output: Since PRNGs are deterministic, the same seed will always yield the same sequence of numbers. This
characteristic allows for reproducibility in experiments and simulations. However, if the seed is predictable or not sufficiently
random, it can compromise the quality of the generated sequence.
3. Entropy and Security: In cryptographic applications, the seed must be secure and unpredictable to prevent attackers from
reproducing the generated sequences. Poor seed management can lead to vulnerabilities, making it easier for adversaries to
predict the output of a PRNG.
4. Reseeding: To maintain randomness over time and prevent predictability, PRNGs may incorporate mechanisms for reseeding.
This involves periodically updating the seed with new sources of entropy, ensuring that the generated numbers remain
unpredictable even after many iterations.
The influence of the seed on the sequence produced by a PRNG can be summarized as follows:
1. Reproducibility: The primary influence of the seed is reproducibility. When a PRNG is seeded with the same value, it
generates the same sequence, which is useful for debugging and testing.
2. Variability: Different seeds lead to different sequences of numbers. This variability is essential for simulations, statistical
sampling, and other applications requiring unique random sequences.
3. Impact on Statistical Properties: The choice of seed can affect the statistical properties of the output sequence. A poorly
chosen seed may produce biased or non-uniform distributions, undermining the randomness required for certain applications.
4. Security Implications: In cryptography, the seed’s security is paramount. A weak or predictable seed can allow attackers to
reverse-engineer the PRNG and predict future outputs. Therefore, strong entropy sources are vital for generating seeds in
secure applications.
Pseudorandom number generation is a vital process that underpins many areas of computing, from simulations and gaming to
cryptography. The seed plays a central role in this process, determining the initial state of the generator and influencing the entire
sequence of numbers produced. By ensuring that seeds are chosen carefully and using robust algorithms, effective PRNGs can produce
sequences that are sufficiently random for practical applications while maintaining reproducibility when needed. Understanding the
principles of pseudorandom number generation and the critical role of the seed helps in designing secure and reliable systems in a
variety of fields.
Discuss the significance of Hamming distance and Hamming weight in error detection and correction, providing examples of how
they are used in coding theory.
Hamming distance and Hamming weight are essential concepts in coding theory, particularly in the context of error detection and
correction. As digital communication systems rely heavily on the accurate transmission and storage of data, understanding these
metrics is crucial for developing reliable codes that can identify and rectify errors. This discussion will delve into the definitions,
*QB203 (a)
significance, and applications of Hamming distance and Hamming weight in error correction and detection mechanisms.
Hamming Distance
Definition:
The Hamming distance between two binary strings of equal length is the number of positions at which the corresponding bits differ.
For instance, consider the following two binary strings:
● String A: 11001
● String B: 10111
● Comparing positions:
○ 1 vs 1 → no difference
○ 1 vs 0 → difference
○ 0 vs 1 → difference
○ 0 vs 1 → difference
○ 1 vs 1 → no difference
The Hamming distance between String A and String B is 3, as they differ in three positions.
Significance:
Hamming Weight
Definition:
The Hamming weight of a binary string is the count of non-zero bits (or '1's) in the string. For example, for the binary string 1011001,
the Hamming weight is 4, as there are four '1's present.
Significance:
Hamming weight plays a vital role in coding theory by influencing:
1. Code Construction: The design of error-correcting codes often considers the Hamming weight of codewords to achieve
desired error detection and correction properties. Codes are constructed to have specific weights, ensuring robustness against
errors.
2. Weight Distribution: The distribution of Hamming weights among codewords affects the performance of error correction. A
good distribution can help maximize the likelihood of detecting and correcting errors, thus enhancing the overall reliability of
the code.
2. Reed-Solomon Codes:
Reed-Solomon codes are widely utilized in various digital communication systems, such as QR codes, CDs, and DVDs. They are
particularly effective for correcting burst errors, which occur when multiple consecutive bits are corrupted.
● The minimum Hamming distance of a Reed-Solomon code is determined by its parameters (e.g., the number of symbols and
redundancy). The code can correct multiple symbol errors, relying on its Hamming distance to establish the number of
correctable errors.
Reed-Solomon codes utilize Hamming distance to ensure that the codewords are sufficiently spaced apart, allowing for robust error
correction across multiple data symbols.
3. LDPC Codes:
Low-Density Parity-Check (LDPC) codes are advanced error correction codes that leverage the concepts of Hamming distance and
weight. These codes are designed for applications such as satellite communication and wireless networks, where reliable data
transmission is crucial.
● Both types of codes achieve high performance by using iterative decoding algorithms, with their effectiveness influenced by
the minimum Hamming distance of the code. A larger distance improves error correction capability, enabling these codes to
operate close to the Shannon limit of channel capacity.
(Or)
Demonstrate the concept of stream ciphers by encrypting a simple plaintext message using the RC4 algorithm. Show the step-by-step
encryption process.
*QB203 (b) Stream ciphers, like RC4 (Rivest Cipher 4), encrypt plaintext one byte at a time, using a key stream generated from a secret key. The
process involves a few key steps: initializing the state, generating the key stream, and then encrypting the plaintext by combining it
with the key stream using bitwise XOR.
Example:
The encryption of a simple plaintext message using the RC4 algorithm. We will encrypt the plaintext "HELLO" with a key of "KEY".
Discuss how the choice of key and initialization vector (IV) affects the randomness of numbers generated by a block cipher.
Pseudorandom number generation using a block cipher is a well-established method that leverages the security and complexity of
*QB204 (a) block cipher algorithms to produce a sequence of pseudorandom numbers.
Pseudorandom Process
Steps to Generate Pseudorandom Numbers Using a Block Cipher
1. Select a Block Cipher: Choose a secure block cipher algorithm (e.g., AES, DES, Blowfish). The block cipher will be used to
transform input data into a pseudorandom output.
2. Key Generation: Generate a secret key for the block cipher. The key must be kept secure, as the security of the pseudorandom
numbers depends heavily on the secrecy of the key.
3. Initialization Vector (IV): If required by the block cipher mode (like CBC), generate an initialization vector (IV). The IV
should be random and unique for each session to prevent predictability.
4. Input Seed: Choose an input seed value (could be a counter, nonce, or any unique value). This seed will be fed into the block
cipher to generate the pseudorandom output.
5. Block Cipher Operation:
○ Use the block cipher in a suitable mode of operation (e.g., ECB, CBC, CTR).
○ Encrypt the input seed with the secret key using the block cipher. For example, if using AES in ECB mode:
■ output = AES(key, seed)
6. Extract Pseudorandom Bytes: Take the output from the encryption operation as the pseudorandom number. Depending on
the block size of the cipher (e.g., 128 bits for AES), you might obtain a fixed-size block (16 bytes) as the pseudorandom output.
7. Repeat as Needed: Increment the input seed (if using a counter) or use a new seed/IV for subsequent calls. Continue to
generate more pseudorandom numbers by repeating the encryption steps.
Example Process
Steps:
Security Implications
Using a block cipher for pseudorandom number generation has several security implications:
1. Cryptographic Security:
○ If the underlying block cipher is secure (e.g., AES), the output will also be secure against prediction and reverse
engineering, assuming a secret key is used.
○ The pseudorandom sequence should ideally pass statistical tests for randomness and unpredictability.
2. Key Management:
○ The security of the pseudorandom numbers relies heavily on the secrecy and strength of the key. Poor key
management can lead to vulnerabilities.
○ Key rotation and proper key generation practices are critical to maintaining security.
3. Initialization Vectors (IVs):
○ If an IV is used, it must be unique and unpredictable for each instance to prevent replay attacks and ensure that the
output is not the same for identical seeds.
○ Reusing IVs with the same key can lead to security weaknesses.
4. Statefulness:
○ Depending on how the block cipher is used (e.g., with counters), the generator may need to maintain state. This state
must be securely managed to avoid leakage of information.
○ Stateless generators (like those using a fixed seed without counters) may lead to predictability.
5. Output Length:
○ The length of the output must be considered. A block cipher generates fixed-length outputs, so if long sequences of
pseudorandom numbers are needed, multiple blocks must be generated. Care must be taken to avoid patterns or
correlations between blocks.
Using a block cipher to generate pseudorandom numbers is an effective method that combines the cryptographic strength of the cipher
with the need for randomness. It is crucial to implement the process securely, ensuring proper key management, IV uniqueness, and
adherence to best practices in cryptographic implementations. If done correctly, this method provides a robust source of pseudorandom
numbers suitable for applications like cryptographic protocols, simulations, and secure communications.
(Or)
Bring out the differences and similarities between pseudorandom number generators (PRNGs) and true random number generators
(TRNGs).
A Pseudorandom Number Generator (PRNG) is an algorithm that generates a sequence of numbers that approximates the properties
of random numbers. While the numbers produced by a PRNG may appear random, they are generated using deterministic processes,
meaning that if you start with the same initial value (known as a seed), you will always get the same sequence of numbers.
1. Non-Deterministic: TRNGs generate unique and unpredictable random numbers; the same conditions will not produce the
same output.
2. Physical Entropy Source: They use natural phenomena (like thermal noise or radioactive decay) to generate randomness.
3. Slower Speed: TRNGs are generally slower than PRNGs because they rely on physical processes to produce random numbers.
*QB204 (b) 4. High Entropy: The randomness they produce is highly unpredictable and suitable for secure applications.
5. Hardware Requirement: TRNGs often need specialized hardware to measure and process the physical randomness.
A True Random Number Generator (TRNG) is a device or system that generates random numbers from a physical source of
randomness, such as thermal noise, radioactive decay, or electronic noise. Unlike Pseudorandom Number Generators (PRNGs), which
produce numbers based on deterministic algorithms, TRNGs rely on inherently unpredictable physical phenomena to generate random
values.
1. Deterministic: PRNGs generate the same sequence of numbers if started with the same initial value (seed).
2. Fast: They can produce random numbers quickly, making them suitable for applications requiring high-speed generation.
3. Periodic: PRNGs have a finite period, meaning the sequence will eventually repeat after a certain number of outputs, although
good PRNGs have very long periods.
4. Stateful: They maintain internal state information that influences the generation of subsequent numbers.
5. Quality of Randomness: The randomness quality depends on the algorithm used; some PRNGs can exhibit predictable
patterns if not designed properly.
Feature Pseudorandom Number Generators (PRNGs) True Random Number Generators (TRNGs)
Definition Algorithms that generate number sequences that Devices that generate numbers from a physical source
approximate the properties of random numbers. The of randomness (e.g., thermal noise, radioactive
sequence is determined by an initial value (seed). decay).
Determinism Deterministic; the same seed will produce the same Non-deterministic; output is based on unpredictable
sequence. physical processes.
Speed Generally faster due to algorithmic computation. Slower due to physical processes involved in
generating randomness.
Reproducibility Output can be reproduced if the initial seed is known. Output cannot be reproduced; each output is unique.
Complexity Less complex; can be implemented easily in software. More complex; often requires specialized hardware.
Security Level Depends on the algorithm and seed management; may be Typically considered more secure as they rely
vulnerable if seeds are predictable. on unpredictable physical phenomena.
Applications Widely used in simulations, games, and applications Used in high-security applications (e.g., key
where speed is critical (e.g., cryptographic key generation, secure communication protocols) where
generation in some contexts). unpredictability is crucial.
Entropy Source Relies on initial seed value and algorithm; may lack Sources of entropy are truly random; provides high
sufficient entropy if not carefully seeded. entropy for secure applications.
Limitations - Can produce predictable sequences if the algorithm is - Hardware-dependent, making it less portable.
weak or poorly implemented. - May have limitations in speed and throughput.
- Vulnerable to attacks if the seed is known or can be - Environmental factors can affect output quality.
guessed.
Use in Often used for generating keys and nonces, but must be Preferred for generating cryptographic keys and
Cryptography chosen carefully to ensure unpredictability. other critical random values, as they provide
higher security assurance.
UNIT - III
Q. No Questions
Describe the process by which the Data Encryption Standard (DES) algorithm encrypts plaintext using a specified key.
DES:
Data Encryption Standard (DES) is a block cipher with a 56-bit key length that has played a significant role in data security. Data
encryption standard (DES) has been found vulnerable to very powerful attacks therefore, the popularity of DES has been found
slightly on the decline. DES is a block cipher and encrypts data in blocks of size of 64 bits each, which means 64 bits of plain text
go as the input to DES, which produces 64 bits of ciphertext. The same algorithm and key are used for encryption and decryption,
with minor differences. The key length is 56 bits.
The basic idea is shown below:
We have mentioned that DES uses a 56-bit key. Actually, The initial key consists of 64 bits. However, before the DES process even
starts, every 8th bit of the key is discarded to produce a 56-bit key. That is bit positions 8, 16, 24, 32, 40, 48, 56, and 64 are discarded.
*QB301 (a)
Thus, the discarding of every 8th bit of the key produces a 56-bit key from the original 64-bit key.
DES is based on the two fundamental attributes of cryptography: substitution (also called confusion) and transposition (also called
diffusion). DES consists of 16 steps, each of which is called a round. Each round performs the steps of substitution and transposition.
Let us now discuss the broad-level steps in DES.
● In the first step, the 64-bit plain text block is handed over to an initial Permutation (IP) function.
● The initial permutation is performed on plain text.
● Next, the initial permutation (IP) produces two halves of the permuted block; saying Left Plain Text (LPT) and Right
Plain Text (RPT).
● Now each LPT and RPT go through 16 rounds of the encryption process.
● In the end, LPT and RPT are rejoined and a Final Permutation (FP) is performed on the combined block
● The result of this process produces 64-bit ciphertext.
Initial Permutation (IP)
As we have noted, the initial permutation (IP) happens only once and it happens before the first round. It suggests how the
transposition in IP should proceed, as shown in the figure. For example, it says that the IP replaces the first bit of the original plain
text block with the 58th bit of the original plain text, the second bit with the 50th bit of the original plain text block, and so on.
This is nothing but jugglery of bit positions of the original plain text block. the same rule applies to all the other bit positions shown
in the figure.
As we have noted after IP is done, the resulting 64-bit permuted text block is divided into two half blocks. Each half-block consists
of 32 bits, and each of the 16 rounds, in turn, consists of the broad-level steps outlined in the figure.
We have noted initial 64-bit key is transformed into a 56-bit key by discarding every 8th bit of the initial key. Thus, for each a 56-bit
key is available. From this 56-bit key, a different 48-bit Sub Key is generated during each round using a process called key
transformation. For this, the 56-bit key is divided into two halves, each of 28 bits. These halves are circularly shifted left by one or
two positions, depending on the round.
For example: if the round numbers 1, 2, 9, or 16 the shift is done by only one position for other rounds, the circular shift is done by
two positions. The number of key bits shifted per round is shown in the figure.
After an appropriate shift, 48 of the 56 bits are selected. From the 48 we might obtain 64 or 56 bits based on requirement which helps
us to recognize that this model is very versatile and can handle any range of requirements needed or provided. for selecting 48 of the
56 bits the table is shown in the figure given below. For instance, after the shift, bit number 14 moves to the first position, bit number
17 moves to the second position, and so on. If we observe the table , we will realize that it contains only 48-bit positions. Bit number
18 is discarded (we will not find it in the table), like 7 others, to reduce a 56-bit key to a 48-bit key. Since the key transformation
process involves permutation as well as a selection of a 48-bit subset of the original 56-bit key it is called Compression Permutation.
Because of this compression permutation technique, a different subset of key bits is used in each round. That makes DES not easy to
crack.
Recall that after the initial permutation, we had two 32-bit plain text areas called Left Plain Text(LPT) and Right Plain Text(RPT).
During the expansion permutation, the RPT is expanded from 32 bits to 48 bits. Bits are permuted as well hence called expansion
permutation. This happens as the 32-bit RPT is divided into 8 blocks, with each block consisting of 4 bits. Then, each 4-bit block of
the previous step is then expanded to a corresponding 6-bit block, i.e., per 4-bit block, 2 more bits are added.
This process results in expansion as well as a permutation of the input bit while creating output. The key transformation process
compresses the 56-bit key to 48 bits. Then the expansion permutation process expands the 32-bit RPT to 48-bits. Now the 48-bit
key is XOR with 48-bit RPT and the resulting output is given to the next step, which is the S-Box substitution.
(Or)
● Advanced Encryption Standard (AES) is a highly trusted encryption algorithm used to secure data by converting
it into an unreadable format without the proper key.
● It is developed by the National Institute of Standards and Technology (NIST) in 2001.
● It is widely used today as it is much stronger than DES and triple DES despite being harder to implement.
*QB301 (b)
● AES encryption uses various key lengths (128, 192, or 256 bits) to provide strong protection against unauthorized
access.
● AES is found at least six time faster than triple DES.A replacement for DES was needed as its key size was too small. With
increasing computing power, it was considered vulnerable against exhaustive key search attack.
● Triple DES was designed to overcome this drawback but it was found slow.
The features of AES are as follows −
Operation of AES
AES is an iterative rather than Feistel cipher. It is based on ‘substitution–permutation network’. It comprises of a series of linked
operations, some of which involve replacing inputs by specific outputs (substitutions) and others involve shuffling bits around
(permutations).
Interestingly, AES performs all its computations on bytes rather than bits. Hence, AES treats
the 128 bits of a plaintext block as 16 bytes. These 16 bytes are arranged in four columns and
four rows for processing as a matrix −
Unlike DES, the number of rounds in AES is variable and depends on the length of the key. AES uses 10 rounds for 128-bit keys,
12 rounds for 192-bit keys and 14 rounds for 256-bit keys. Each of these rounds uses a different 128-bit round key, which is calculated
from the original AES key.
Shiftrows
Each of the four rows of the matrix is shifted to the left. Any entries that ‘fall off’ are re-
inserted on the right side of row. Shift is carried out as follows −
Add roundkey
The 16 bytes of the matrix are now considered as 128 bits and are XORed to the 128 bits of the round key. If this is the last round
then the output is the ciphertext. Otherwise, the resulting 128 bits are interpreted as 16 bytes and we begin another similar round.
Decryption Process
The process of decryption of an AES ciphertext is similar to the encryption process in the
reverse order. Each round consists of the four processes conducted in the reverse order −
Since sub-processes in each round are in reverse manner, unlike for a Feistel Cipher, the encryption and decryption algorithms needs
to be separately implemented, although they are very closely related.
AES Analysis
In present day cryptography, AES is widely adopted and supported in both hardware and software. Till date, no practical cryptanalytic
attacks against AES has been discovered. Additionally, AES has built-in flexibility of key length, which allows a degree of ‘future-
proofing’ against progress in the ability to perform exhaustive key searches.
Elaborate on the Triple DES (3DES) encryption algorithm in detail, including appropriate diagrams to illustrate each step of the
process.
Triple DES is an encryption algorithm based on the original Data Encryption Standard (DES). It is a symmetric encryption algorithm
that uses multiple rounds of the Data Encryption Standard (DES) to improve security. It is also known as Triple DES because it uses
the Data Encryption Standard (DES) cypher which takes three times to encrypt its data. It is essentially a block cypher used to encrypt
data in 64-bit blocks. Security-wise, it outperforms the original Data Encryption Standard (DES). However, Triple DES is less
*QB302 (a) efficient and slower than the Advanced Encryption Standard (AES).
Features of Triple DES
· It utilizes a triple layer of encryption which means it utilizes three different keys to encrypt the plaintext three times.
· It supports variable key sizes which range from 128 bits to 192 bits.
· It basically involves the usage of a symmetric key encryption system, which states that the same key is used for both
encryption and decryption.
· It is a block cypher encryption algorithm that works with 64-bit blocks of plaintext at a time.
· It is suitable for legacy systems that require secure encryption.
Encryption Process
The Encryption process of Triple DES involves the following steps:-
Key Generation
This is the first step of the Encryption process of Triple DES. In this step, three unique keys are generated using a key derivation
algorithm.
Initial Permutation
This step comes after the process of Key Generation. It involves the rearrangement of the bits of the plaintext according to a predefined
permutation table.
Three Rounds of Encryption
This is regarded as the most important round of the encryption process of Triple DES. It consists of multiple rounds typically 48
rounds in total. In this step, the plaintext is processed three times and get encrypted, each time we take use of a different key, to create
three layers of encryption.
Final Permutation
It completes the Triple DES encryption process. In this step, the resulting ciphertext block undergoes a final permutation (FP)
operation, which is the inverse of the initial permutation. It returns the bits of the ciphertext block to their original order.
Advantages
● As compared to the triple-layered encryption to the original DES, security is enhanced.
● 3DES allows for smooth migrations through preserving connectivity with current DES implementations.
● By setting each of all three keys to the same value, 3DES can be used for a single DES with respect to backward compatibility.
● 3DES is widely used and integrated with a wide range of hardware, protocols, and applications.
Disadvantages
● The slower speed of 3DES compared to recent encryption methods like AES decreases processing efficiency.
● Even while 3DES is more powerful than DES, its efficient key length is limited, especially if three 56-bit keys are used.
● In scenarios with limited resources, the triple encryption process reduces performance because it needs more computing
power.
● 3DES has a lower security margin than more recent encryption methods like AES, but being more secure than DES.
(Or)
Analyze the Feistel structure operation including the processes of encryption and decryption
The Feistel cipher structure is a symmetric structure used in block cipher designs. It was proposed by Horst Feistel in the 1970s and
is the basis for many well-known block ciphers like DES (Data Encryption Standard) and its successor AES (Advanced Encryption
Standard). The Feistel structure operates by iteratively applying a round function to the input data, typically dividing it into two
halves, with one half acting as the "left" part and the other as the "right" part. The basic structure involves several rounds of
processing, each round consisting of a mixing (also called a permutation or substitution) stage followed by a nonlinear function
(called the round function), and finally, a mixing of the two halves.
*QB302 (b)
The Feistel structure operates in both encryption and decryption:
Encryption:
Key Expansion: The encryption process begins with the expansion of the input key into a set of round keys, one for each round.
Initial Permutation: The plaintext block is initially permuted according to a fixed permutation.
Rounds: The plaintext block is divided into two halves (left and right). Each round performs the following operations:
Right Half Expansion:
The right half of the block is expanded to match the size of the round key.
Round Key Mixing: The expanded right half is XORed with the round key.
Non-linear Transformation (Round Function): The result of the XOR operation undergoes a
non-linear transformation, typically involving substitution boxes (S-boxes) or similar operations.
Permutation: The output of the non-linear transformation is permuted or rearranged.
XOR with Left Half: The permuted output is XORed with the original left half of the block.
Swap: After the XOR operation, the left and right halves are swapped.
Final Permutation: After completing all rounds, a final permutation is applied to the output of the last round.
Output: The final permuted output is the ciphertext.
Decryption:
Decryption in a Feistel cipher involves applying the same operations as encryption but in reverse order. The round keys used for
decryption are often the same as those used for
encryption but applied in reverse order.
Key Expansion: Same as in encryption, the round keys are generated.
Initial Permutation: The ciphertext block undergoes the same initial permutation as in encryption.
Rounds (in reverse order): The decryption process involves performing the following operations for each round:
Swap: Unlike in encryption, the left and right halves are swapped before any operations are
performed.
Right Half Expansion: Same as in encryption, the right half is expanded.
Round Key Mixing: The expanded right half is XORed with the round key.
Non-linear Transformation (Round Function): The XOR result is passed through the inverse of the round function.
Permutation: The output of the non-linear transformation is permuted.
XOR with Left Half: The permuted output is XORed with the original left half.
Final Permutation: After completing all rounds in reverse order, the final permutation is applied.
Output: The output of the final permutation is the plaintext. The Feistel structure provides a simple and effective way to create
secure block ciphers, offering properties like confusion and diffusion, which are essential for achieving cryptographic strength.
Provide a detailed explanation of the key principles involved in the design of block ciphers and Analyze their impact on encryption
security.
Block Cipher is an encryption algorithm that works with a symmetric key in a deterministic way. The plain text is divided into several
blocks of equal size. If the length of the plain text does not allow block division of equal size, padding is done over the plain text. His
type of encryption method can encrypt on blocks of 128 bits, the key can be 128, 192, or 256 bits. In block ciphers, the length of the
plain text is equal to the length of the cipher text.
*QB303 (a) This type of encryption process considered each block at a time and gives an output of n bits for an input of n bits. But if there are
two identical blocks, the process will produce two different cipher texts for them. It is a reversible function having a public and a
private key, which makes its computation easy and also a deterministic process.
1. Confusion:
○ Enhances resistance against cryptanalysis techniques like differential cryptanalysis.
○ Prevents patterns from emerging in ciphertext, reducing statistical attack effectiveness.
2. Diffusion:
○ Hides structural similarities between plaintext and ciphertext.
○ Increases difficulty in frequency analysis attacks.
3. Key Schedule and Key Expansion:
○ Improves resistance to related-key attacks.
○ Prevents weaknesses from repetitive round keys.
4. Avalanche Effect:
○ Small input changes lead to unpredictable ciphertext variations.
○ Reduces feasibility of brute-force and differential attacks.
5. Multiple Rounds of Encryption:
○ Strengthens resistance to linear and differential cryptanalysis.
○ Increases security, even if partial information is exposed.
6. Large Block and Key Sizes:
○ Prevents brute-force attacks by increasing key search complexity.
○ Reduces risk of birthday attacks and ciphertext collisions.
7. Resistance to Known Cryptanalytic Attacks:
○ Ensures long-term security against evolving cryptanalysis methods.
○ Protects data from adversaries with significant computational power.
(Or)
Apply the concept of block cipher modes of operation to demonstrate how different modes affect the encryption and decryption
process of a given data.
Encryption algorithms are divided into two categories based on the input type: block cipher and stream cipher. A block cipher is an
encryption algorithm that takes a fixed-size input (e.g., b bits) and produces a ciphertext of b bits. If the input is larger than b bits, it
can be divided further.
Block Cipher Modes of Operation define how to securely encrypt and decrypt large amounts of data using a block cipher. A block
*QB303 (b) cipher is an encryption algorithm that processes data in fixed-size blocks (e.g., 128 bits) rather than one bit at a time. However, to
encrypt data larger than a single block, different modes of operation are used to ensure both security and efficiency.
● Secure Large Data Encryption: Block cipher modes allow for secure encryption of data larger than a single block (e.g.,
files, messages).
● Enhanced Security: Proper modes can provide properties such as confidentiality, integrity, and resistance to certain types
of cryptographic attacks.
● Versatile Application: Different modes cater to various use cases, such as secure file storage, network communication, and
authenticated encryption.
● Error Propagation Control: Some modes are designed to limit how encryption errors affect decryption.
There are several modes of operation for a block cipher, each suited for different applications and uses.
The electronic codebook is the easiest block cipher mode of functioning. It is easier because of the direct encryption of each block
of input plaintext and output is in the form of blocks of encrypted ciphertext. Generally, if a message is larger than b bits in size, it
can be broken down into a bunch of blocks and the procedure is repeated.
Cipher block chaining or CBC is an advancement made on ECB since ECB compromises some security requirements. In CBC, the
previous cipher block is given as input to the next encryption algorithm after XOR with the original plaintext block. In a nutshell
here, a cipher block is produced by encrypting an XOR output of the previous cipher block and present plaintext block.
Advantages of CBC
Advantages of CFB
● Since, there is some data loss due to the use of shift register, thus it is difficult for applying cryptanalysis.
● Can handle data streams of any size.
Disadvantages of using CFB
● The drawbacks of CFB are the same as those of CBC mode. Both block losses and concurrent encryption of several blocks
are not supported by the encryption. Decryption, however, is parallelizable and loss-tolerant.
● Slightly more complex and can propagate errors.
The output feedback mode follows nearly the same process as the Cipher Feedback mode except that it sends the encrypted output
as feedback instead of the actual cipher which is XOR output. In this output feedback mode, all bits of the block are sent instead of
sending selected s bits. The Output Feedback mode of block cipher holds great resistance towards bit transmission errors. It also
decreases the dependency or relationship of the cipher on the plaintext.
Advantages of OFB
● In the case of CFB, a single bit error in a block is propagated to all subsequent blocks. This problem is solved by OFB as it
is free from bit errors in the plaintext block. Thus errors in transmission don’t propagate.
Disadvantages of OFB
● The drawback of OFB is that, because to its operational modes, it is more susceptible to a message stream modification
attack than CFB.
● If the keystream is reused, security is compromised.
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.
● 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.
(i) Explain Chinese Remainder theorem and find X for the given set of congruent equation
using CRT (7) X ≡ 2 (mod 3) X ≡ 3 (mod 5) X ≡ 2 (mod 7)
This solution is found modulo the product of all the numbers (N = n1 · n2 ·...· nk). Therefore, x satisfies each equation
by leaving the same remainder when divided by its corresponding number (ni) as the given number (ai).
x ≡ a2 (mod n2)
x ≡ ak (mod nk)
there exists a unique solution x modulo (N = n1 n2 .... nk) that satisfies all the congruences simultaneously.
Theorem
Ø Chinese Remainder Theorem: If m1, m2, .., mk are pairwise relatively prime positive integers, and if a1,
a2, .., ak are any integers, then the simultaneous congruences
x ≡ ak (mod mk)
have a solution, and the solution is unique modulo m, where m = m1, m2⋅⋅⋅mk.
That is a unique solution x with 0 ≤ x ≤ m.
Algorithm
For the Chinese Remainder Theorem to work, the numbers we are dividing by must not have any common factors. So, if there are
two numbers that are being divided by, say (mi) and (mj), then they can not have common factors other than 1. That means their
biggest shared factor, called the greatest common divisor is 1.
GCD(mi, mj) = 1
This condition ensures that the system of congruences is consistent and that the solution provided by the Chinese Remainder Theorem
is unique modulo the product of the moduli. If the moduli are not pairwise coprime, then the theorem may not yield a solution, or the
solution may not be unique. Therefore, pairwise coprimality is a fundamental requirement for the application of the Chinese
Remainder Theorem.
X≡23(mod105)
(Or)
Discuss about Public Key distribution and Symmetric-Key Distribution.
Public key distribution is a crucial aspect of modern cryptography that facilitates the secure sharing of public keys used in
asymmetric (public-key) cryptographic systems. Proper public key distribution ensures that individuals or entities can safely share
and verify public keys for secure communication and data exchange. Here, we will discuss the need for public key distribution,
methods for distributing keys, and challenges associated with it.
● Public key: Used for encryption or verifying signatures and is openly shared.
● Private key: Kept secret by the owner and used for decryption or signing.
Secure Communication: Enabling parties to securely exchange data, even if they have not previously shared any secret keys.
*QB304 (b) Authentication: Ensuring that the public key used actually belongs to the intended recipient.
● Non-repudiation: Verifying that a message or document was indeed signed by the private key owner.
● Definition: A hierarchical framework that manages public keys and certificates through trusted Certificate Authorities
(CAs).
● Process:
○ A user generates a public-private key pair.
○ The public key is sent to a CA, which verifies the user's identity and issues a digital certificate that binds the public
key to the user’s identity.
○ Others can verify the certificate through the CA’s public key.
b) Web of Trust
● Definition: A decentralized trust model used by systems like PGP (Pretty Good Privacy).
● Process:
○ Users sign each other's keys to indicate trust, forming a network or “web” of trust relationships.
○ Each user decides whom they trust and uses those trusted relationships to validate other keys.
c) Key Servers
● Definition: Centralized or distributed servers where public keys can be uploaded and retrieved.
● Process:
○ Users upload their public keys to a key server.
○ Others can query the server to retrieve public keys for secure communication.
d) Blockchain-Based Distribution
● Definition: Public keys are distributed and verified through a blockchain ledger.
● Process:
○ Public keys are recorded on the blockchain, which is immutable and decentralized.
○ Anyone can verify the authenticity of a public key using the blockchain.
● Definition: Public keys are distributed through trusted channels (e.g., face-to-face meetings, physical media).
● Advantages:
○ High trust level if the channel is secure.
● Challenges:
○ Impractical for large-scale use.
○ Time-consuming and limited in scope.
Symmetric-key distribution refers to the methods and processes used to securely share cryptographic keys between parties in a
symmetric-key cryptosystem. In symmetric encryption, the same key is used for both encryption and decryption, making the secure
exchange of this key vital for maintaining confidentiality and security.
The security of symmetric-key cryptography hinges on ensuring that the key remains confidential and is shared only with
authorized parties. Without secure key distribution, any adversary who intercepts the key could decrypt encrypted data,
compromising the confidentiality of the communication.
Several techniques can be used to distribute symmetric keys securely. Below are common approaches:
● Description: The key is exchanged in person or through a secure physical medium (e.g., a secure courier service, USB
drive).
● Description: Keys are shared beforehand and used for secure communication.
UNIT - IV
Q. No. Questions
Describe how the RSA cryptosystem functions, covering the processes of key generation, encryption, and decryption.
*QB401 (a)
RSA Cryptosystem
RSA(Rivest-Shamir-Adleman) Algorithm is an asymmetric or public-key cryptography algorithm which means it works on two
different keys: Public Key and Private Key. The Public Key is used for encryption and is known to everyone, while the Private Key
is used for decryption and must be kept secret by the receiver. RSA Algorithm is named after Ron Rivest, Adi Shamir and Leonard
Adleman, who published the algorithm in 1977.
Example of Asymmetric Cryptography:
If Person A wants to send a message securely to Person B:
● Person A encrypts the message using Person B’s Public Key.
● Person B decrypts the message using their Private Key.
Functioning of RSA Cryptosystem:
RSA is based on the problem of breaking down large numbers into their top factors. To create an RSA key pair, you need to pick very
big prime numbers, p and q. It is crucial to pick those primes randomly and ensure they are simply unique from each different. The
product of p and q, represented as n, becomes the modulus for the public and private keys. While n is publicly known, the values of p
and q remain confidential.
The carmecheals' totient function of the product of two primes, p and q, is computed. An integer, e, is chosen as the public exponent.
The final step involves calculating d, which serves as the private exponent.
Example
Let's say we choose p = 61 and q = 53.
n = p * q = 61 * 53 = 3233
So, the public key is (3233, 17), and the private key is (3233, 2753).
RSA Algorithm
RSA Algorithm is based on factorization of large number and modular arithmetic for encrypting and decrypting data. It consists of
three main stages:
1. Key Generation: Creating Public and Private Keys
2. Encryption: Sender encrypts the data using Public Key to get cipher text.
3. Decryption: Decrypting the cipher text using Private Key to get the original data.
1. Key Generation
● Choose two large prime numbers, say p and q. These prime numbers should be kept secret.
● Calculate the product of primes, n = p * q. This product is part of the public as well as the private key.
● Calculate Euler Totient FunctionΦ(n) as Φ(n) = Φ(p * q) = Φ(p) * Φ(q) = (p – 1) * (q – 1).
● Choose encryption exponent e, such that
○ 1 < e < Φ(n), and
○ gcd(e, Φ(n)) = 1, that is e should be co-prime with Φ(n).
● Calculate decryption exponent d, such that
○ (d * e) ≡ 1 mod Φ(n), that is d is modular multiplicative inverse of e mod Φ(n). Some common
methods to calculate multiplicative inverse are: Extended Euclidean Algorithm, Fermat’s Little Theorem,
etc.
○ We can have multiple values of d satisfying (d * e) ≡ 1 mod Φ(n) but it does not matter which value
we choose as all of them are valid keys and will result into same message on decryption.
Finally, the Public Key = (n, e) and the Private Key = (n, d).
2. Encryption
To encrypt a message M, it is first converted to numerical representation using ASCII and other encoding schemes. Now, use the public
key (n, e) to encrypt the message and get the cipher text using the formula:
C = Me mod n, where C is the Cipher text and e and n are parts of public key.
3. Decryption
To decrypt the cipher text C, use the private key (n, d) and get the original data using the formula:
M = Cd mod n, where M is the message and d and n are parts of private key.
The idea of RSA is based on the fact that it is difficult to factorize a large integer. The Public Key is (n, e), where n and e are publicly
known, while the Private Key is (n, d). Since only the receiver knows the value of d, only they can decrypt the message. But is it
possible to find the value of d using n and e?
We know that (d * e) ≡ 1 mod Φ(n), so if we can calculate the value of Φ(n), we can find the value of d. But Φ(n) = (p – 1) * (q
– 1). So, we need the value of p and q. Now, one might think that it’s quite easy to find the value of p and q as n = p * q and n is already
publicly known but RSA Algorithm takes the value of p and q to be very large which in turn makes the value of n extremely large and
factorizing such a large value is computationally impossible.
Therefore encryption strength lies in the values of p and q. RSA keys can be typically 1024 or 2048 bits long, but experts believe that
1024-bit keys could be broken shortly. But till now it seems to be an infeasible task.
Note: If someone gets to know the value of p and q, then he can calculate the value of d and decrypt the message.
(Or)
*QB401 (b) Discuss the Diffie-Hellman key exchange protocol and evaluate its significance in cryptography.
Diffie-Hellman key exchange is a method of digital encryption that securely exchanges cryptographic keys between two parties over a
public channel without their conversation being transmitted over the internet. The two parties use symmetric cryptography to encrypt
and decrypt their messages. Published in 1976 by Whitfield Diffie and Martin Hellman, it was one of the first practical examples of
public key cryptography.
Diffie-Hellman key exchange raises numbers to a selected power to produce decryption keys. The components of the keys are never
directly transmitted, making the task of a would-be code breaker mathematically overwhelming. The method doesn't share information
during the key exchange. The two parties have no prior knowledge of each other, but the two parties create a key together.
Where is Diffie-Hellman key exchange used?
Diffie-Hellman key exchange's goal is to securely establish a channel to create and share a key for symmetric key algorithms. Generally,
it's used for encryption, password-authenticated key agreement and forward security. Password-authenticated key agreements are used
to prevent man-in-the-middle (MitM) attacks. Forward secrecy-based protocols protect against the compromising of keys by generating
new key pairs for each session.
Diffie-Hellman key exchange is commonly found in security protocols, such as Transport Layer Security (TLS), Secure Shell (SSH)
and IP Security (IPsec). For example, in IPsec, the encryption method is used for key generation and key rotation.
Even though Diffie-Hellman key exchange can be used for establishing both public and private keys, the Rivest-Shamir-Adleman
algorithm, or RSA algorithm, can also be used, since it's able to sign public key certificates.
To implement Diffie-Hellman, two end users, Alice and Bob, mutually agree on positive whole numbers p and q, such that p is a prime
number and q is a generator of p. The generator q is a number that, when raised to positive whole-number powers less than p, never
produces the same result for any two such whole numbers. The value of p may be large, but the value of q is usually small.
Once Alice and Bob have agreed on p and q in private, they choose positive whole-number personal keys a and b. Both are less than
the prime number modulus p. Neither user divulges their personal key to anyone; ideally, they memorize these numbers and don't write
them down or store them anywhere. Next, Alice and Bob compute public keys a* and b* based on their personal keys according to the
following formulas:
a* = qa mod p
b* = qb mod p
The two users can share their public keys a* and b* over a communications medium assumed to be insecure, such as the internet or a
corporate wide area network. From these public keys, a number x can be generated by either user on the basis of their own personal
keys. Alice computes x using the following formula:
x = (b*) mod p
x = (a*) mod p
The value of x turns out to be the same according to either of the above two formulas. However, the personal keys a and b, which are
critical in the calculation of x, haven't been transmitted over a public medium. Because it's a large and apparently random number, a
potential hacker has almost no chance of correctly guessing x, even with the help of a powerful computer to conduct millions of trials.
The two users can, therefore, in theory, communicate privately over a public medium with an encryption method of their choice using
the decryption key x.
The most serious limitation of Diffie-Hellman in its basic form is the lack of authentication. Communications using Diffie-Hellman by
itself are vulnerable to MitM. Ideally, Diffie-Hellman should be used in conjunction with a recognized authentication method, such as
digital signatures, to verify the identities of the users over the public communications medium.
Diffie-Hellman key exchange is also vulnerable to logjam attacks, specifically against the TLS protocol. Diffie-Hellman key exchange
can still be secure if implemented correctly. For example, logjam attacks won't work with a 2,048-bit key.
If two people, say Alice and Bob, want to communicate sensitive data over an open public network but want to avoid hackers or
eavesdroppers, they can use the Diffie-Hellman key exchange method for encryption. This open public network could be at a cafe, for
example.
Alice and Bob privately choose a secret key, and a function is run on these keys to create a public key. The results -- and not the function
-- are shared. Even if a third party is listening in, that third party won't have all the involved numbers, making it difficult to derive the
function the numbers came from.
From here, Alice and Bob each run a new function using the results they received from the opposite party, their own secret number and
the original prime value. Alice and Bob then arrive at a common shared secret key that a third party can't deduce. Alice and Bob are
now free to communicate without worrying about third parties.
Compare the RSA and ElGamal cryptosystems based on security, efficiency, and applications, and assess their overall performance.
*QB402 (a)
1. Security
RSA Security
Based on Prime Factorization: The security of RSA relies on the difficulty of factoring a large integer, specifically the modulus 𝑛=𝑝×𝑞
Vulnerability to Quantum Computing: If sufficiently powerful quantum computers become practical, they could factor large integers
rapidly (using Shor’s algorithm), rendering RSA insecure in such scenarios.
Potential Weakness in Key Generation: RSA security depends heavily on random, large prime selection and safe key generation
practices. Improperly generated keys (e.g., small primes, low entropy) can weaken the system.
ElGamal Security
Based on Discrete Logarithm Problem (DLP): ElGamal’s security is grounded in the difficulty of solving the discrete logarithm problem
over large prime fields. This is computationally hard, especially with large key sizes.
Quantum Threats: Like RSA, ElGamal is also vulnerable to quantum attacks, as quantum computers could theoretically solve DLP
efficiently.
Randomness Requirement: ElGamal requires the generation of a new random number, or nonce, for each encryption operation. Reusing
nonces can make ElGamal encryption vulnerable to certain attacks, such as the “chosen ciphertext attack.” RSA and ElGamal are both
vulnerable to quantum computing advancements but remain secure with current classical computing. ElGamal is slightly more resilient
in specific scenarios due to the discrete logarithm problem but requires careful handling of nonces to maintain security.
2. Efficiency
RSA Efficiency
Key Generation: RSA key generation is computationally intensive, as it requires generating large primes and calculating the totient.
However, once the keys are generated, they can be reused for multiple encryptions.
Encryption and Decryption: RSA encryption with a small public exponent (e.g., 3 or 65537) is relatively fast, but decryption can be
slower due to large private exponent calculations.
Ciphertext Size: RSA produces a fixed-size ciphertext regardless of plaintext length, making it predictable but potentially less efficient
in terms of storage.
ElGamal Efficiency
Key Generation: ElGamal’s key generation is relatively fast and less computationally intense compared to RSA.
Encryption and Decryption: ElGamal encryption is slower than RSA because it requires multiple exponentiations. Decryption is also
more computationally expensive due to its reliance on exponentiation and modular arithmetic.
Ciphertext Expansion: ElGamal encryption produces a ciphertext that is twice the size of the plaintext, leading to increased storage and
bandwidth requirements, especially for large data sets. RSA is generally faster in encryption, especially when using small exponents,
but decryption can be slower.
ElGamal has slower encryption/decryption due to multiple exponentiations and produces a larger ciphertext, making it less storage-
efficient.
3. Usage
RSA Usage
Widely Adopted in Secure Communications: RSA is commonly used in SSL/TLS protocols, digital signatures, and secure email. Its
extensive use and support across libraries make it a popular choice for secure key exchange.
Digital Signatures: RSA supports digital signatures effectively, providing authentication, integrity, and non-repudiation.
Short Message Encryption: RSA is primarily used for encrypting small messages or symmetric keys (for hybrid encryption) rather than
large datasets, given its efficiency limitations with long plaintexts.
ElGamal Usage
Hybrid Encryption Systems: ElGamal is often used in combination with symmetric ciphers to encrypt large datasets. It’s suitable for
systems that use a hybrid encryption approach (e.g., encrypting the symmetric key with ElGamal and data with a symmetric cipher).
Digital Signatures (DSA): A variation of ElGamal, known as the Digital Signature Algorithm (DSA), is used for digital signatures. DSA
is standardized and widely implemented in cryptographic applications.
Preference in Resource-Constrained Environments: Due to its smaller key sizes and efficient key generation, ElGamal is sometimes
preferred in resource-constrained environments over RSA. RSA is widely adopted for public-key encryption and digital signatures in
many internet security protocols.
ElGamal is favored in hybrid encryption schemes and for digital signatures in the form of DSA.
ECC is based on another area of advanced mathematics called elliptic curves. An elliptic curve is defined by an equation in the form of
y2 = x3 + ax + b, where a and b are constants and the curve is defined over a finite field. When graphed, it looks like this:
Elliptic curves have some special properties that make them interesting and useful to both mathematicians and cryptographers. First,
elliptic curves are horizontally symmetrical. When reflected across the x-axis (the horizontal line), both sides are the same, like a mirror
image.
Additionally, any non-vertical straight line drawn through an elliptic curve will always intersect the curve in, at most, three places. In
the example below, those points are labeled as P, Q and R.
The security of elliptic curve cryptography is based on the difficulty of solving what’s known as the elliptic curve discrete logarithm
problem. Given a point P on the curve and a scalar k, it is extraordinarily difficult to determine the point Q such that Q = k*P – much
more difficult than it is to factor even a very large number.
This property means that ECC can provide comparable or even better security than RSA with far lower key sizes.
The fact that ECC provides a very high level of security with short key lengths gives it advantages over RSA and other public-key
cryptography algorithms.
These advantages make ECC particularly useful in resource-constrained environments, such as mobile and Internet of Things (IoT)
devices.
While the RSA encryption algorithm is extremely secure, ECC is arguably even better.
Quantum computers theoretically have the potential to break RSA by efficiently solving the factoring problem on which RSA relies.
Whether this will happen anytime soon is a matter of great debate. However, it is safe to say that, due to ECC’s complexity, it is more
resistant to quantum computing attacks compared to RSA.
How resistant? Dutch mathematician Arjen Lenstra co-wrote a research paper that compared breaking cryptographic algorithms to
boiling water. The idea is to compute how much energy it requires to break a specific cryptographic algorithm, then calculate how much
water that energy could boil. Using this metaphor, it takes less energy to crack a 228-bit RSA key than it does to boil a teaspoon of
water, but the energy expended on breaking a 228-bit ECC key could boil all the water on Earth. The same level of security with RSA
would require a key size of 2,380 bits.
ECC’s smaller key size makes it a perfect fit for devices with low CPU and memory resources, such as mobile and IoT devices. This
enables web and mobile app developers to build high-performance, low-latency websites and applications while still offering their users
robust data security. ECC is frequently used to secure wireless mobile communication protocols like Bluetooth, Wi-Fi and Near Field
Communication (NFC).
While ECC is rather new compared to RSA, it enjoys broad standardization and support from private-sector organizations and industry
bodies. For example, the U.S. National Institute of Standards and Technology (NIST) has standardized ECC in its suite of cryptographic
algorithms. Additionally, ECC is supported by popular cryptographic libraries, programming languages and operating systems. This
acceptance further promotes its adoption in various sectors such as finance, healthcare and government services.
Considering these factors, it is safe to say that elliptic curve cryptography is popular and widely used in a variety of applications and
industries. Its efficiency, security and broad support have made it a trusted choice for secure communication and cryptographic
operations.
User A and B exchange the key using the Diffie-Hellman algorithm. AVVXPH_ q=11 XA=2 XB=3. Find the value of YA, YB and k?
*QB403 (a)
Soln:
The Diffie-Hellman Key Exchange Algorithm is a method used to securely exchange cryptographic keys over a public channel. The
process involves the following steps:
Given Data:
Both User A and User B will derive the same shared secret key K=9K = 9K=9, ensuring secure communication.
(Or)
Explain how symmetric key distribution is achieved using symmetric encryption.
*QB403 (b)
SYMMETRIC KEY DISTRIBUTION USING SYMMETRIC ENCRYPTION
For symmetric encryption to work, the two parties to an exchange must share the same key, and that key must be protected from access
by others. Furthermore, frequent key changes are usually desirable to limit the amount of data compromised if an attacker learns the
key. Therefore, the strength of any cryptographic system rests with the key distribution technique, a term that refers to the means of
deliver- ing a key to two parties who wish to exchange data without allowing others to see the key.
For two parties A and B, key distribution can be achieved in a number of ways, as follows:
2.A third party can select the key and physically deliver it to A and B.
[Link] A and B have previously and recently used a key, one party can transmit the new key to the other, encrypted using the old key.
4 If A and B each has an encrypted connection to a third party C, C can deliver a key on the encrypted links to A and B.
Options 1 and 2 call for manual delivery of a key. For link encryption, this is a reasonable requirement, because each link encryption
device is going to be exchang- ing data only with its partner on the other end of the link. However, for end-to-end encryption over a
network, manual delivery is awkward. In a distributed system, any given host or terminal may need to engage in exchanges with many
other hosts and terminals over time. Thus, each device needs a number of keys supplied dynamically. The problem is especially difficult
in a wide-area distributed system.
The scale of the problem depends on the number of communicating pairs that must be supported. If end-to-end encryption is done at a
network or IP level, then a key is needed for each pair of hosts on the network that wish to communicate. Thus, if there are N hosts, the
number of required keys is [N(N - 1)]/2 . If encryption is done at the application level, then a key is needed for every pair of users or
processes that require communication. Thus, a network may have hundreds of hosts but thousands of users and processes.
The use of a key distribution center is based on the use of a hierarchy of keys. At a minimum, two levels of keys are used (Figure 14.2).
Communication between end systems is encrypted using a temporary key, often referred to as a session key. Typically, the session key
is used for the duration of a logical connection, such as a frame relay connection or transport connection, and then discarded. Each
session key is obtained from the key distribution center over the same networking facilities used for end-user communication.
Accordingly, session keys are transmitted in encrypted form, using a master key that is shared by the key distribution center and an end
system or user.
For each end system or user, there is a unique master key that it shares with the key distribution center. Of course, these master keys
must be distributed in some fashion. However, the scale of the problem is vastly reduced. If there are N entities that wish to communicate
in pairs, then, as was mentioned, as many as [N(N - 1)]/2 session keys are needed at any one time. However, only N master keys are
required, one for each entity. Thus, master keys can be distributed in some noncryptographic way, such as physical delivery.
The key distribution concept can be deployed in a number of ways. A typical sce- nario is illustrated in Figure 14.3, which is based on
a figure in [POPE79]. The sce- nario assumes that each user shares a unique master key with the key distribution center (KDC).
Let us assume that user A wishes to establish a logical connection with B and requires a one-time session key to protect the data
transmitted over the connection. A has a master key, Ka, known only to itself and the KDC; similarly, B shares the master key Kb with
the KDC. The following steps occur.
1. A issues a request to the KDC for a session key to protect a logical connection to B. The message includes the identity of A and B
and a unique identifier, N1, for this transaction, which we refer to as a nonce. The nonce may be a time- stamp, a counter, or a random
number; the minimum requirement is that it dif- fers with each request. Also, to prevent masquerade, it should be difficult for an
opponent to guess the nonce. Thus, a random number is a good choice for a nonce.
2. The KDC responds with a message encrypted using Ka. Thus, A is the only one who can successfully read the message, and A knows
that it originated at the KDC. The message includes two items intended for A:
• The original request message, including the nonce, to enable A to match this response with the appopriate request
Thus, A can verify that its original request was not altered before reception by the KDC and, because of the nonce, that this is not a
replay of some previous request.
In addition, the message includes two items intended for B:
These last two items are encrypted with Kb (the master key that the KDC shares with B).They are to be sent to B to establish the
connection and prove A’s identity.
3.A stores the session key for use in the upcoming session and forwards to B the information that originated at the KDC for B, namely,
E(Kb,[Ks || IDA]). Because this information is encrypted with Kb, it is protected from eavesdrop- ping. B now knows the session key
(Ks), knows that the other party is A (from IDA), and knows that the information originated at the KDC (because it is encrypted using
Kb).
At this point, a session key has been securely delivered to A and B, and they may begin their protected exchange. However, two
additional steps are desirable:
4. Using the newly minted session key for encryption, B sends a nonce, N2, to A.
[Link], using Ks, A responds with f(N2) , where f is a function that performs some transformation on N2 (e.g., adding one).
These steps assure B that the original message it received (step 3) was not a replay.
Note that the actual key distribution involves only steps 1 through 3, but that steps 4 and 5, as well as step 3, perform an authentication
function.
It is not necessary to limit the key distribution function to a single KDC. Indeed, for very large networks, it may not be practical to do
so. As an alternative, a hierarchy of KDCs can be established. For example, there can be local KDCs, each responsible for a small
domain of the overall internetwork, such as a single LAN or a single building. For communication among entities within the same local
domain, the local KDC is responsible for key distribution. If two entities in different domains desire a shared key, then the corresponding
local KDCs can communicate through a global KDC. In this case, any one of the three KDCs involved can actually select the key. The
hierarchical concept can be extended to three or even more layers, depending on the size of the user population and the geographic
scope of the internetwork.
A hierarchical scheme minimizes the effort involved in master key distribu- tion, because most master keys are those shared by a local
KDC with its local enti- ties. Furthermore, such a scheme limits the damage of a faulty or subverted KDC to its local area only.
The more frequently session keys are exchanged, the more secure they are, because the opponent has less ciphertext to work with for
any given session key. On the other hand, the distribution of session keys delays the start of any exchange and places a burden on
network capacity. A security manager must try to balance these competing considerations in determining the lifetime of a particular
session key.
For connection-oriented protocols, one obvious choice is to use the same ses- sion key for the length of time that the connection is open,
using a new session key for each new session. If a logical connection has a very long lifetime, then it would be prudent to change the
session key periodically, perhaps every time the PDU (protocol data unit) sequence number cycles.
For a connectionless protocol, such as a transaction-oriented protocol, there is no explicit connection initiation or termination. Thus, it
is not obvious how often one needs to change the session key. The most secure approach is to use a new ses- sion key for each exchange.
However, this negates one of the principal benefits of connectionless protocols, which is minimum overhead and delay for each
transaction. A better strategy is to use a given session key for a certain fixed period only or for a certain number of transactions.
The approach suggested in Figure 14.3 has many variations, one of which is described in this subsection. The scheme (Figure 14.4) is
useful for providing end-to- end encryption at a network or transport level in a way that is transparent to the end users. The approach
assumes that communication makes use of a connection-ori- ented end-to-end protocol, such as TCP. The noteworthy element of this
approach is a session security module (SSM), which may consist of functionality at one protocol layer, that performs end-to-end
encryption and obtains session keys on behalf of its host or terminal.
The steps involved in establishing a connection are shown in Figure 14.4. When one host wishes to set up a connection to another host,
it transmits a connec- tion-request packet (step 1). The SSM saves that packet and applies to the KDC for permission to establish the
connection (step 2). The communication between the SSM and the KDC is encrypted using a master key shared only by this SSM and
the KDC. If the KDC approves the connection request, it generates the session key and delivers it to the two appropriate SSMs, using a
unique permanent key for each SSM (step 3). The requesting SSM can now release the connection request packet, and a connection is
set up between the two end systems (step 4). All user data exchanged between the two end systems are encrypted by their respective
SSMs using the one- time session key.
The automated key distribution approach provides the flexibility and dynamic characteristics needed to allow a number of terminal
users to access a number of hosts and for the hosts to exchange data with each other.
(iv)Decentralized Key Control
The use of a key distribution center imposes the requirement that the KDC be trusted and be protected from subversion. This requirement
can be avoided if key distribution is fully decentralized. Although full decentralization is not practical for larger networks using
symmetric encryption only, it may be useful within a local context.
A decentralized approach requires that each end system be able to communi- cate in a secure manner with all potential partner end
systems for purposes of ses- sion key distribution. Thus, there may need to be as many as [n(n - 1)]/2 master keys for a configuration
with n end systems.
A session key may be established with the following sequence of steps (Figure 14.5).
2. B responds with a message that is encrypted using the shared master key. The response includes the session key selected by B, an
identifier of B, the value f(N1), and another nonce, N2.
(ii) How can we encrypt the plaintext 9 using the RSA public-key encryption algorithm with prime numbers 7 and 11 to generate the
public and private keys? (8 marks)
(i) Explanation:
Step 1: In the first step, select two large prime numbers, p and q.
p=3
q = 13
Step 2: Multiply these numbers to find n = p x q, where n is called the modulus for encryption and decryption.
First, we calculate
n=pxq
n = 3 x 13
n = 39
Step 3: If n = p x q, then the public key is <e, n>. A plaintext message m is encrypted using public key <e, n>. Thus the public key is
<e, n> = (3, 39).
To find ciphertext from the plain text following formula is used to get ciphertext C. Let's assume the plaintext to be a number. For
example, let's take plaintext m = 5:
C = me mod n
C = 53 mod 39
C = 125 mod 39
C=8
So, if the plaintext is 5, then the ciphertext would be 8.
(ii)Solution:
Step 1: Select two large prime numbers, p, and q.
p=7
q = 11
Step 2: Multiply these numbers to find n = p x q, where n is called the modulus for encryption and decryption.
First, we calculate
n=pxq
n = 7 x 11
n = 77
Step 3: Choose a number e less than n, such that n is relatively prime to (p - 1) x (q -1). It means that e and (p - 1) x (q - 1) have no
common factor except 1. Choose "e" such that 1<e < φ (n), e is prime to φ (n), gcd (e, d (n)) =1.
Second, we calculate
φ (n) = (p - 1) x (q-1)
φ (n) = (7 - 1) x (11 - 1)
φ (n) = 6 x 10
φ (n) = 60
Step 4: A plaintext message m is encrypted using public key <e, n>. To find ciphertext from the plain text following formula is used
to get ciphertext C.
To find ciphertext from the plain text following formula is used to get ciphertext C.
C = me mod n
C = 97 mod 77
C = 4782969 mod 77
C = 37
(Or)
Discuss the components, algorithms, and applications of Elliptic Curve Cryptography (ECC), explaining how they contribute to
*QB404 (b) secure communication.
Cryptography is the study of techniques for secure communication in the presence of adversarial behavior. Encryption uses an algorithm
to encrypt data and a secret key to decrypt it. There are 2 types of encryption:
Symmetric-key Encryption (secret key encryption): Symmetric-key algorithms are cryptographic algorithms that employ the same
cryptographic keys both for plaintext encryption and ciphertext decoding. The keys could be identical, or there could be a simple
transition between them.
Asymmetric-key encryption (public key encryption): Asymmetric-key algorithms encrypt and decrypt a message using a pair of
related keys (one public key and one private key) and safeguard it from unauthorized access or usage.
1. ECC keys:
Private key: ECC cryptography’s private key creation is as simple as safely producing a random integer in a specific range, making it
highly quick. Any integer in the field represents a valid ECC private key.
Public keys: Public keys within ECC are EC points, which are pairs of integer coordinates x, and y that lie on a curve. Because of its
unique features, EC points can be compressed to a single coordinate + 1 bit (odd or even). As a result, the compressed public key
corresponds to a 256-bit ECC.
2. Generator Point:
ECC cryptosystems establish a special pre-defined EC point called generator point G (base point) for elliptic curves over finite fields,
which can generate any other position in its subgroup over the elliptic curve by multiplying G from some integer in the range [0…r].
Elliptic curve subgroups typically contain numerous generator points, but cryptologists carefully select one of them to generate the
entire group (or subgroup), and is excellent for performance optimizations in calculations. This is the “G” generator.
Elliptic Curve Cryptography Algorithms
Based on the arithmetic of elliptic curves over finite fields, Elliptic-Curve Cryptography (ECC) provides numerous sets of algorithms:
Elliptic Curve Digital Signature Algorithm. (ECDSA): ECDSA, or Elliptic Curve Digital Signature Algorithm, is a more highly
complicated public-key cryptography encryption algorithm. Elliptic curve cryptography is a type of public key cryptography that uses
the algebraic structure of elliptic curves with finite fields as its foundation. Elliptic curve cryptography is primarily used to generate
pseudo-random numbers, digital signatures, and other data.
Edwards-curve Digital Signature Algorithm (EdDSA): The Edwards-curve Digital Signature Algorithm (EdDSA) was proposed as
a replacement for the Elliptic Curve Digital Signature Algorithm for performing fast public-key digital signatures (ECDSA). Its primary
benefits for embedded devices are higher performance and simple, secure implementations. During a signature, no branch or lookup
operations based on the secret values are performed. Many side-channel attacks are foiled by these properties.
Encryption algorithms:
Elliptic Curve Integrated Encryption Scheme (ECIES): ECIES is a public-key authenticated encryption scheme that uses a KDF
(key-derivation function) to generate a separate Medium Access Control key and symmetric encryption key from the ECDH shared
secret. Because the ECIES algorithm incorporates a symmetric cipher, it can encrypt any amount of data. In practice, ECIES is used by
standards such as Intelligent Transportation Systems.
EC-based ElGamal Elliptic Curve Cryptography: ElGamal Elliptic Curve Cryptography is the public key cryptography equivalent
of ElGamal encryption schemes that employ the Elliptic Curve Discrete Logarithm Problem. ElGamal is an asymmetric encryption
algorithm that is used to send messages securely over long distances. Unfortunately, if the encrypted message is short enough, the
algorithm is vulnerable to a Meet in the Middle attack.
Elliptic-curve Diffie–Hellman (ECDH): Elliptic-curve Diffie-Hellman (ECDH) is a key agreement protocol that enables two parties
to establish a shared secret over an insecure channel, each with an elliptic-curve public-private key pair. This shared secret can be used
directly as a key or to generate another key. Following that, the key, or the derived key, can be used to encrypt subsequent
communications with a symmetric-key cipher.
Fully Hashed Menezes-Qu-Vanstone(FHMQV): Fully Hashed Menezes-Qu-Vanstone is an authenticated key agreement protocol
based on the Diffie-Hellman scheme. MQV, like other authenticated Diffie-Hellman schemes, protects against an active attacker. The
protocol can be adapted to work in any finite group, most notably elliptic curve groups, in which it is recognized as elliptic curve MQV
(ECMQV).
Diffie-Hellman: The basic public-key cryptosystem suggested for secret key sharing is the Diffie-Hellman protocol. If A (Alice) and
B (Bob) initially agree on a given curve, field size, and mathematical type. They then distribute the secret key in the following manner.
We can see that all we need to build the Diffie-Hellman protocol is scalar multiplication.
Elliptic Curve Digital Signature Algorithm (ECDSA): ECC is one of the most widely utilized digital signature implementation
approaches in cryptocurrencies. In order to sign transactions, both Bitcoin and Ethereum use the field inverse multiplication, but also
arithmetic multiplication, inverse function, and modular operation.
Online application: Moreover, ECC is not limited to cryptocurrencies. It is an encryption standard that will be utilized by most online
apps in the future due to its reduced key size and efficiency. Most commonly used in cryptocurrencies such as Bitcoin and Ethereum,
along with single-way encryption of emails, data, and software.
Blockchain application: The cryptocurrency Bitcoin employs elliptic curve cryptography. Ethereum 2.0 makes heavy use of elliptic
curve pairs with BLS signatures, as stated in the IETF proposed BLS specification, to cryptographically ensure that a specific Eth2
validator has really verified a specific transaction.
UNIT - V
Q. No Questions
QB501 (a) * Explain the concept of Message Authentication and Integrity, including the roles of MAC and hash functions.
Message Authentication and Integrity are essential components of secure communication in cryptography. They ensure that
messages have not been altered and that they originate from a legitimate source. Here’s a breakdown of these concepts:
Message Authentication: This process ensures that the message received by a recipient has come from the intended sender and not
from an unauthorized source. Authentication provides verification of the sender's identity.
Message Integrity: This refers to the assurance that the message has not been altered or tampered with during transmission. Integrity
is crucial in ensuring that the content received is exactly as it was sent.
Together, these properties prevent unauthorized modifications and impersonations, which are critical for maintaining trust in secure
communications.
To achieve message authentication and integrity, cryptographic techniques like Message Authentication Codes (MACs) and Hash
Functions are widely used. These methods provide different levels of security and are often combined to strengthen data protection.
A Message Authentication Code (MAC) is a small block of data generated from a message and a secret key. It verifies both the
authenticity and integrity of a message. MACs are essential in symmetric cryptographic systems, where both the sender and receiver
share the same secret key.
Working of MAC
A MAC is generated by combining the original message with a secret key using a specific algorithm. The resulting code (MAC) is
unique to the combination of the message and the key.
The MAC is then attached to the message and sent to the receiver.
Upon receiving the message, the receiver can verify the integrity and authenticity by recalculating the MAC using the received
message and the shared key. If the newly calculated MAC matches the attached MAC, the message is authenticated and verified as
unchanged.
Types of MACs
CBC-MAC (Cipher Block Chaining MAC): Uses block ciphers in cipher block chaining mode to generate the MAC. Commonly
used in network security protocols.
HMAC (Hash-Based MAC): Combines a cryptographic hash function with a secret key, providing a high level of security and
efficiency. HMAC is widely used due to its robustness and simplicity.
Advantages of MAC
Authentication and Integrity: MACs ensure both that the sender is authenticated and the message has not been altered.
Efficiency: MACs are computationally efficient and are well-suited for environments with limited resources.
Security: HMAC, for example, provides strong security due to its combination of hashing and secret keys.
Limitations of MAC
Symmetric Key Requirement: MACs require the sender and receiver to share a secret key, which can pose key distribution
challenges.
Vulnerability to Forgery: Without proper key management, MACs can be vulnerable to attacks, especially if the same key is used
across multiple communications.
2. Hash Functions
A Hash Function is an algorithm that takes an input message and generates a fixed-size output, called a hash or digest, that uniquely
represents the data. Hash functions are widely used in cryptography due to their properties of determinism, efficiency, and collision
resistance (the difficulty of finding two inputs with the same hash).
Unlike MACs, hash functions do not use a secret key. They are often used to ensure integrity rather than authenticity.
A hash function takes an input message and processes it through a complex mathematical transformation, resulting in a fixed-length
string, the hash or digest.
This hash is unique to the input message, so even a small change in the original message results in a drastically different hash.
When the recipient receives a message along with its hash, they can recalculate the hash on the received message and compare it to
the attached hash. If the two hashes match, the message has not been tampered with.
MD5 (Message Digest Algorithm 5): Produces a 128-bit hash. MD5 is fast but has known vulnerabilities and is generally not
recommended for security-sensitive applications.
SHA (Secure Hash Algorithms): Includes SHA-1, SHA-256, and SHA-3, providing varying levels of security. SHA-256, for
instance, is widely used in cryptographic applications, including SSL certificates and blockchain.
Advantages of Hash Functions
Efficiency: Hash functions are efficient to compute, making them suitable for environments where processing power and storage are
limited.
Data Integrity: Hash functions provide strong integrity verification; even a minor alteration in data results in a completely different
hash, allowing quick identification of changes.
Non-reversible: Hash functions are designed to be non-reversible, meaning it is infeasible to obtain the original data from its hash,
adding a layer of security.
No Authentication: Since hash functions do not use a key, they do not provide authentication. A malicious entity could replace the
original message and hash with another message and corresponding hash.
Vulnerabilities to Collisions: Although strong hash functions like SHA-256 are resistant to collisions, older algorithms like MD5
have known vulnerabilities, where two different inputs produce the same hash, reducing security.
Key Requirement Uses a secret key shared by sender and Does not use a key; operates on message alone
receiver
Application Used in symmetric key systems Used for data integrity, digital signatures
Vulnerability Vulnerable if key is not securely managed Vulnerable to collision attacks in older hash
functions (e.g., MD5)
Applications of MAC and Hash Functions in Ensuring Message Authentication and Integrity
1. Data Transmission Security: MACs are used in protocols like TLS and SSL to ensure data transmitted between servers
and clients is authentic and untampered.
2. Digital Signatures: Hash functions are integral to digital signatures, which are commonly used in email verification and
digital contracts to verify data integrity and signer authenticity.
3. Blockchain and Cryptocurrencies: Cryptographic hashes are used to ensure data integrity within each block in the
blockchain, making data tampering infeasible.
4. File Integrity Checks: Hash functions are widely used for verifying file integrity. Software downloads often provide hash
values so users can confirm the file has not been corrupted or modified.
(Or)
Discuss the SHA algorithm along with its types and features, and analyze the role of the avalanche effect in ensuring hash function
QB501 (b) * security.
SHA algorithm:
SHA stands for secure hashing algorithm. Data and certificates are hashed using SHA, a modified version of MD5. A hashing
algorithm compresses the input data into a smaller, incomprehensible form using bitwise operations, modular additions, and
compression functions. You can be asking if hashing can be hacked or decoded. Hashing is one-way, meaning that once data is
hashed, a brute force attack is needed to break the resulting hash digest. This is the primary difference between hashing and
encryption.
Even in the event that a single character changes in the message, SHA is intended to provide a unique hash.
Hashing two similar but distinct messages, like "Heaven" and "heaven is different," is one example. All that differs, however, is one
small and one capital letter.
SHAs also help to identify any alterations made to the original message. A user can determine whether a single letter has been altered
by comparing the hash digests to the original ones, as they will differ significantly. The deterministic nature of SHA is one of their
key features. This means that any computer or user can reproduce the hash digest as long as they know the hash algorithm that was
used. One of the reasons that all SSL certificates on the Internet must have been hashed using a SHA-2 method is because of the
finite nature of SHAs.
Types of SHA
SHA stands for Secure Hash Algorithm family of cryptographic hash functions. Every SHA type
is distinct and comes in a range of numbers. Here are a few common types −
SHA-1 − This was the first version of SHA. It is currently believed to be less secure as a
result of these weaknesses.
SHA-2 − This includes several hash algorithms with different digest sizes, such as SHA-
224, SHA-256, SHA-384, and SHA-512. They are more secure than SHA-1 and are frequently
used.
SHA-3 − The newest member of the SHA family, it was created using different methods than
SHA-1 and SHA-2. They include SHA3-224, SHA3-256, SHA3-384, and SHA3-512.
Every kind of SHA generates a unique hash value-a fixed-length character string-from the input data. Among other security-related
tasks, these hash values are used in the generation of digital signatures and data integrity verification.
Features of SHA
For cryptography, the Secure Hash Algorithm, or SHA, is useful for several important reasons
−
Data Integrity − SHA generates a fixed-size hash result (often 160, 256, 384, or 512 bits) from
input data of arbitrary size. Since a small change in the input data would produce a
significantly different hash value, it can be used to verify the integrity of data. If the
hash values match, this suggests that the input data has not been altered.
Uniqueness − SHA tries to produce unique hash results for a range of inputs. While it is still
theoretically possible, modern SHA versions (such SHA-256 and SHA-3) are meant to
reduce the probability of two different inputs producing the same hash value (a collision).
Cryptographic Security − Pre-image, second pre-image, collision, and other types of
cryptographic attacks are all things that SHA is meant to handle. This means that it will
be challenging for an attacker to determine two distinct inputs that result in the same
hash value or to reverse-engineer the original input data from its hash value.
Efficiency − SHA algorithms can produce hash values quickly, even for huge amounts of input
data, because they are computationally efficient.
Wide Use − SHA is widely used in a number of security applications, like blockchain
technology, digital signatures, message authentication codes (MACs), and password
hashing.
Future of Hashing
SHA-2 is now the industry standard for hashing algorithms, however SHA-3 may someday overtake it. SHA-3 was released in 2015
by the NIST, which also created SHA-1 and SHA-2. Although, it was never accepted as the industry standard for a number of
reasons. When SHA-3 was released, most organisations were already switching from SHA-1 to SHA-2, therefore it made no sense
to switch to SHA-3 when SHA-2 was still quite secure.
In addition, this is not exactly correct, SHA-3 was seen as being slower than SHA-2. SHA-3 continues to advance with every year,
and while it is slower in software, it is faster in hardware when compared to both SHA-1 and SHA-2.
Avalanche Effect
The hash digest for the original message 'Heaven', hashed with SHA-1, is "06b73bd57b3b938786daed820cb9fa4561bf0e8e." The
hash digest for the second 'heaven', similar message hashed using SHA-1 looks like this:
"66da9f3b8d9d83f34770a14c38276a69433a535b." We call this phenomenon the avalanche effect. This effect is crucial to
cryptography since it means that any modification to the input message might significantly change the result. By doing this, attackers
will be prevented from deciphering the original meaning of the hash digest and from informing the message's recipient about any
modifications made while it was in transit.
QB502 (a) Discuss the role and functioning of Digital Signatures and Authentication Protocols in securing digital communications.
Role and Functioning of Digital Signatures and Authentication Protocols in Securing Digital Communications
Digital communications rely heavily on trust, confidentiality, and integrity to secure sensitive information. Two core technologies
used to establish secure digital communication are Digital Signatures and Authentication Protocols. These mechanisms ensure
that information exchanged between parties is authentic, unaltered, and securely transmitted. Here’s a detailed analysis of their role
and functioning.
1. Digital Signatures
A Digital Signature is a cryptographic tool that verifies the authenticity and integrity of digital messages, documents, and software.
Like a handwritten signature, it is unique to the sender and serves as proof of the message’s origin and integrity.
● Authentication: Confirms that the message is indeed from the claimed sender, verifying the sender’s identity.
● Integrity: Ensures that the message content has not been altered during transmission. Even a slight change in the message
invalidates the signature.
● Non-repudiation: Prevents the sender from denying that they sent the message. Once a digital signature is applied, the
sender cannot credibly claim they didn’t sign the document, providing legal accountability.
These roles make digital signatures essential for applications such as email communication, financial transactions, contract signing,
and secure software distribution.
1. Hashing the Message: The message is first passed through a hash function (such as SHA-256) to generate a fixed-length
hash, or digest, representing the original message. This process ensures that even a minor change in the message results in a
completely different hash, thereby enhancing integrity.
2. Encrypting the Hash with the Private Key: The sender encrypts the hash using their private key to create the digital
signature. This encrypted hash is unique to the sender and the specific message, as it relies on the sender’s private key.
3. Appending the Digital Signature to the Message: The sender attaches the digital signature to the original message and
sends both to the receiver.
4. Verification by the Receiver:
○ Upon receiving the message, the receiver uses the sender’s public key to decrypt the digital signature and retrieve
the hash.
○ The receiver then independently hashes the received message using the same hash function used by the sender.
○ Finally, the receiver compares the two hashes. If they match, the message is verified as authentic and unaltered. A
mismatch indicates either tampering or that the signature is not from the claimed sender.
2. Authentication Protocols
Authentication Protocols are procedures that establish the legitimacy of a user's or device's identity within a network. These
protocols are essential for secure communications, as they prevent unauthorized access and ensure that data is exchanged only
between trusted parties.
● Identity Verification: They confirm the identity of users or devices, ensuring that only legitimate entities have access to
specific resources or communications.
● Access Control: By verifying identities, authentication protocols help enforce access control, allowing only authorized
users to access sensitive information.
● Protection Against Replay and Man-in-the-Middle Attacks: Many protocols include mechanisms to prevent replay
attacks (reusing intercepted credentials) and man-in-the-middle attacks, where an attacker intercepts or modifies the
communication between two parties.
There are several common types of authentication protocols used in digital communication:
1. Password-Based Authentication: Users provide a password that is checked against a stored record. While common,
password-based systems are often vulnerable to brute-force and phishing attacks if not properly protected.
2. Challenge-Response Protocols: A dynamic method where the server issues a challenge (such as a random number), and
the user’s response (encrypted using a shared secret or private key) confirms their identity. An example is the Kerberos
protocol, which relies on cryptographic tickets to authenticate users in a network securely.
3. Public Key Infrastructure (PKI): PKI systems use digital certificates and public-private key pairs to authenticate users
and devices in a network. By associating public keys with verified identities, PKI provides a scalable way to manage
authentication securely, especially in large organizations.
4. Multi-Factor Authentication (MFA): MFA combines multiple authentication factors, such as something you know
(password), something you have (smart card or OTP), and something you are (biometric data). This layered approach
significantly enhances security.
Authentication protocols generally involve a series of steps to verify identities and establish trust:
1. Initiating the Authentication Request: The user or device initiates a connection request, providing initial credentials or
an identification token.
2. Challenge and Verification:
○ For password-based authentication, the server compares the provided password to its stored record.
○ In challenge-response protocols, the server sends a challenge (random nonce), and the client returns a response,
often encrypted with a shared key or private key.
○ In PKI, the user’s digital certificate and public key are validated by a trusted Certificate Authority (CA) to ensure
authenticity.
3. Session Key Establishment: After successful authentication, a secure session key is often established to encrypt further
communication. This key is typically generated for the session, ensuring confidentiality and security during data exchange.
4. Termination and Logging: Authentication protocols also involve steps for session termination, logging access events, and
monitoring for anomalies that could indicate malicious activity.
Both digital signatures and authentication protocols are foundational in digital security, working in tandem to secure
communications:
1. End-to-End Security: Digital signatures ensure that messages are authentic and unaltered, providing trust in the data being
exchanged. Meanwhile, authentication protocols verify that only authorized users can initiate or respond to
communications.
2. Protection Against Man-in-the-Middle Attacks: Authentication protocols and digital signatures can prevent man-in-the-
middle attacks by verifying identities and ensuring that only the intended recipients can decrypt and read the message.
3. Secure Transactions and Digital Contracts: In e-commerce and digital contracts, digital signatures provide legal validity
by ensuring that the signatory cannot deny their participation, while authentication protocols secure the transaction by
verifying user identity.
4. Scalability and Trust in Large Networks: PKI-based authentication, which leverages digital certificates and signatures,
allows organizations to scale secure access across large user bases without compromising security, making it ideal for
corporate networks, government systems, and IoT networks.
(Or)
QB502 (b) Compare and contrast the use of Biometrics and Passwords for entity authentication.
1. Biometrics: Biometric authentication uses unique biological characteristics (such as fingerprints, facial recognition, iris
patterns, and voice) to verify identity. Biometric data is difficult to replicate and usually offers a high level of security.
2. Passwords: Passwords are knowledge-based credentials consisting of alphanumeric characters, symbols, or a combination
of both. Users are authenticated by entering the correct password associated with their account.
Nature of Uses physiological or behavioral traits unique to Uses knowledge-based credentials (secret words or
Authentication each individual phrases)
Ease of Use Highly user-friendly once enrolled; no need to Users must remember complex passwords, often
remember credentials leading to frustration
Security Generally higher security as biometric traits are Prone to guessing, phishing, and brute-force attacks;
hard to duplicate; uniqueness of traits reduces weak passwords can be a major vulnerability
risk
Accuracy High accuracy with advanced biometric systems, Accuracy depends on the strength and complexity of
though false positives or negatives can occur the password, but human error (mistyped passwords) is
common
Resistance to Difficult to steal or spoof, but once Passwords can be easily shared, stolen, or guessed;
Theft compromised, biometric data cannot be reset however, they can be reset if compromised
Privacy Concerns High: biometric data is sensitive and requires Lower privacy concerns, but passwords can still expose
secure handling and storage due to risks of sensitive information if poorly managed
misuse
Cost and Expensive due to specialized hardware (e.g., Cost-effective, only requiring software support for
Infrastructure fingerprint or facial recognition scanners) password creation and verification
Scalability Scales well for individuals but can become Easily scalable for any size of system; software-based,
complex for large systems requiring biometric requiring minimal infrastructure changes
databases
Use Cases Commonly used in smartphones, high-security Common in everyday systems like websites, online
systems, and facilities requiring strong access accounts, and general applications
control
User Experience Seamless and quick, no need to remember; non- Can be cumbersome, especially with complex,
intrusive for most users frequently changing passwords
Vulnerability to Biometric accuracy can be affected by Unaffected by physical conditions, although password
Environmental environmental conditions (e.g., dirt on a entry may be hindered by device or input method
Factors fingerprint scanner, poor lighting for facial limitations
recognition)
Revocability Once compromised, biometrics cannot be "reset" Passwords can be reset or changed if compromised
or replaced (e.g., fingerprints)
Advantages and Disadvantages of Biometrics and Passwords
Security High security, hard to Once compromised, cannot Easily resettable if Vulnerable to social
duplicate be changed compromised engineering, brute force
User No need to remember; Environmental factors can Universally understood, Can be cumbersome to
Convenience easy to use hinder functionality no special hardware remember and type
Privacy High privacy risk if Requires secure storage and Minimal privacy risk if Risk of exposure if
mishandled compliance well managed poorly managed
Implementati Long-term cost savings High initial setup cost for Low cost, software- Minimal ongoing
on Cost hardware based infrastructure required
QB503 (a) Evaluate the impact of Differential and Linear Cryptanalysis on the design and security of hash functions and MACs.
Differential and linear cryptanalysis are two powerful techniques for analyzing the security of cryptographic systems, including hash
functions and Message Authentication Codes (MACs). They have significantly influenced the way modern cryptographic algorithms
are designed and evaluated.
Differential Cryptanalysis
Differential cryptanalysis studies how differences in input data (plaintext) affect differences in output data (ciphertext or hash). This
technique is particularly useful for attacking block ciphers and hash functions.
1. Collision Resistance:
○ Hash functions like MD5 and SHA-1, which were once widely used, have been broken using differential
cryptanalysis. This made it possible to find two different inputs (collisions) that produce the same hash.
2. Design Improvements:
○ Newer hash functions, such as SHA-2 and SHA-3, have been designed to resist differential attacks. They use more
complex operations and better mixing of input data to prevent attackers from exploiting patterns.
Impact on MACs:
Linear Cryptanalysis
Linear cryptanalysis looks for linear relationships between input, output, and key bits. By identifying these relationships, attackers
can reduce the effort needed to recover a key or break a cryptographic function.
Impact on MACs:
1. Weak MACs:
○ If the underlying block cipher of a MAC is weak against linear cryptanalysis, the MAC can also be broken. This
allows attackers to forge authentication tags.
2. Enhanced Security:
○ Newer MAC designs ensure their underlying components resist both differential and linear attacks, providing
stronger security guarantees.
Differential and linear cryptanalysis have exposed weaknesses in many older cryptographic algorithms, prompting the development
of stronger, more secure systems. These techniques have become essential tools for testing the security of hash functions and MACs,
ensuring they can withstand modern attacks. Their influence continues to shape the field of cryptography today.
(Or)
QB503 (b)* Discuss the challenges and solutions associated with key management and distribution in cryptographic systems.
Key management and distribution are crucial aspects of cryptographic systems, as the security of these systems relies heavily on the
proper handling of cryptographic keys. However, managing keys presents several challenges, particularly in environments where
security, scalability, and user convenience must be balanced.
Key Challenges
Explain the Digital Signature Standard (DSS), detailing its working principles, applications and analyse the benefits of advanced
QB504 (a) * signature.
Working principle
Digital Signature Standard (DSS) is a Federal Information Processing Standard(FIPS) which defines algorithms that are used to
generate digital signatures with the help of Secure Hash Algorithm(SHA) for the authentication of electronic documents. DSS only
provides us with the digital signature function and not with any encryption or key exchanging strategies.
Sign any document online efficiently and organize your workflow with the user-friendly and highly secure e-signature platform
SignNow. With this, you can easily share any electronic documents for signature, keep track of them, and even sign the documents
on any device.
Sender Side: In DSS Approach, a hash code is generated out of the message and following inputs are given to the signature function
–
1. The hash code.
2. The random number ‘k’ generated for that particular signature.
3. The private key of the sender i.e., PR(a).
4. A global public key(which is a set of parameters for the communicating principles) i.e., PU(g).
These input to the function will provide us with the output signature containing two components – ‘s’ and ‘r’. Therefore, the original
message concatenated with the signature is sent to the receiver.
Receiver Side : At the receiver end, verification of the sender is done. The hash code of the sent message is generated. There is a
verification function which takes the following inputs –
1. The hash code generated by the receiver.
2. Signature components ‘s’ and ‘r’.
3. Public key of the sender.
4. Global public key.
The output of the verification function is compared with the signature component ‘r’. Both the values will match if the sent signature
is valid because only the sender with the help of it private key can generate a valid signature.
Applications of DSS
DSS is widely used in security protocols and digital authentication processes. Key applications include:
(Or)
QB504 (b) Analyze the importance of authentication protocols in protecting online transactions and communications.
Authentication protocols are critical to securing online transactions and communications in a world increasingly reliant on digital
interactions. They ensure that data is exchanged between legitimate parties and help prevent unauthorized access, data breaches, and
fraudulent activities.
Authentication is the process of verifying the identity of an entity—be it a user, device, or system—before granting access to
resources or services. Authentication protocols are designed to establish trust between communicating parties in a secure and efficient
manner.
1. Data Integrity: Ensures that messages are not altered during transmission.
2. Confidentiality: Verifies that only authorized parties can access sensitive information.
3. Non-repudiation: Provides evidence that a specific entity initiated a transaction, preventing denial of actions.
In online transactions, authentication protocols protect sensitive data such as credit card details, personal information, and login
credentials. Some commonly used protocols include:
Secure online communication relies heavily on robust authentication mechanisms to prevent eavesdropping, impersonation, and
unauthorized access.
1. Challenge-Response Protocols:
○ In these protocols, the server sends a random challenge to the client, which the client responds to using a secret key.
This prevents replay attacks and ensures the authenticity of the communicating parties.
2. Two-Factor Authentication (2FA):
○ Combining two authentication factors (e.g., password and a one-time code) significantly enhances security by
making it harder for attackers to gain unauthorized access.
3. Digital Signatures:
○ Digital signatures provide a means of authenticating messages, ensuring that the message originated from the
claimed sender and has not been altered.
Challenges and Solutions in Authentication Protocols
Challenges:
Solutions:
1. Advanced Protocols:
○ Protocols like FIDO2 offer passwordless authentication, reducing the risk of credential theft.
2. Mutual Authentication:
○ Ensures that both parties (client and server) verify each other’s identity.
3. Continuous Authentication:
○ Monitors user behavior throughout a session, adding an extra layer of security.
UNIT - I
Q. No Questions
Consider the plaintext "pay more money" and Compute the hill cipher encryption using the key below:
| 17 17 5 |
K= | 21 18 21 |
|2 2 19 |
• Hill Cipher
*QC101 (a)
Encryption and decryption can be given by the following formulae:
Encryption: 𝐶 = 𝑃𝐾 𝑚o𝑑 26
Decryption: 𝑃 = 𝐶𝐾−1 𝑚o𝑑 26
FOR DECRYPTION
such that:
23 ⋅ x ≡ 1 mod 26
This means we need to find a number x such that when we multiply it by 23 and take the result modulo 26, we get 1.
To find the multiplicative inverse of 23 modulo 26, we can use the extended Euclidean algorithm or simply notice that 23 and 26
are coprime. In this case, the multiplicative inverse exists.
23 ⋅ 17 = 391
391 mod 26 = 1
(Or)
Solve:
Generate the corresponding ciphertext for the given PlainText: "instruments" and
keyword: monarchy using playfair cipher.
(i) Rules/Procedure/Algorithm for computing Playfair cipher (5)
(ii) Split letters and generate the key Square (5×5) (10)
Playfair Cipher
The best-known multiple letter encryption cipher is the Playfair, which treats diagrams in the plaintext as single
units and translates these units into cipher text diagrams. The Playfair algorithm is based on the use of 5x5 matrix
of letters constructed using a keyword. The technique encrypts pairs of letters instead of single letters.
Example
Key: Monarchy
*QC101 (b)
Plaintext: instruments
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.
PlainText: "instruments"
Encrypted Text: cl
Encryption:
m -> c e -> l
If both the letters are in the same row: Take the letter to the right of each one (going back to the leftmost if at the
rightmost position).
For example:
Diagraph : “st”
encrypted text: tl
s->t t->l
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: Diagraph: "nt"
Encrypted text: rq
encryption:
n->r t->q
For example:
Q. No Questions
Analyze how the noisy-channel coding theorem affects error correction and reliability in communication systems.
The noisy-channel coding theorem, introduced by Claude Shannon in 1948, is one of the cornerstones of information theory. It
defines the limits of reliable communication over noisy communication channels and provides a framework for understanding how
error correction can be achieved in such systems. Shannon's theorem demonstrates that, even in the presence of noise, reliable
communication is possible as long as the data transmission rate stays below a certain threshold, called the channel capacity. This
theorem has profound implications for the design of communication systems, particularly in terms of error correction and reliability.
*QC201 (a)
The Noisy-Channel Coding Theorem
The noisy-channel coding theorem primarily addresses two key aspects in communication systems:
1. The maximum amount of information that can be transmitted over a noisy channel without error. This is defined by the
channel capacity, which quantifies the upper limit of reliable transmission.
2. The strategies that can be employed to ensure the reliability of transmitted information, even in the presence of noise. These
strategies often involve the use of error-correcting codes, which add redundancy to the transmitted data, enabling the receiver
to detect and correct errors that may occur during transmission.
Overall, the theorem highlights the importance of understanding both the limitations imposed by noise and the techniques available to
mitigate its effects in communication systems.
Channel Capacity
At the heart of the theorem is the concept of channel capacity. Channel capacity represents the maximum rate at which information
can be transmitted over a noisy channel while still allowing for the possibility of error-free communication. This rate depends on the
nature of the channel, including its noise characteristics, bandwidth, and signal-to-noise ratio (SNR). Shannon defined the channel
capacity CCC in terms of the maximum amount of information (measured in bits) that can be reliably transmitted per unit of time.
This formula reflects the maximum data rate that can be achieved without error under ideal conditions, assuming appropriate error
correction techniques are applied.
Error Correction
One of the key insights of the noisy-channel coding theorem is that errors can be corrected as long as the transmission rate is below
the channel capacity. Shannon's theorem doesn't specify exactly how to perform error correction but proves that such techniques exist.
The basic idea is that redundancy can be added to the transmitted data, enabling the receiver to detect and correct errors caused by
noise in the channel.
1. Forward Error Correction (FEC): In this approach, additional bits (parity or redundant bits) are added to the transmitted
data, allowing the receiver to detect and correct errors without the need for retransmission.
2. Automatic Repeat Request (ARQ): This method relies on retransmissions. When the receiver detects errors in the received
data, it requests that the sender retransmit the erroneous portions.
The choice of error correction method depends on the characteristics of the channel and the system requirements. FEC is commonly
used in situations where retransmissions are impractical, such as satellite communications, while ARQ is often used in systems like
wireless networking, where retransmissions are feasible.
The noisy-channel coding theorem provides a theoretical guarantee that, by using the right error-correcting codes, reliable
communication is possible as long as the rate of transmission is less than the channel capacity. Coding refers to the process of adding
redundancy to the data to help detect and correct errors.
● Hamming Codes: Simple error-detecting and error-correcting codes that can correct single-bit errors.
● Reed-Solomon Codes: Commonly used in CDs, DVDs, and QR codes, these codes can correct multiple errors within a block
of data.
● Turbo Codes and LDPC Codes: Advanced coding schemes used in modern communication systems like 4G and 5G cellular
networks. These codes approach the limits set by Shannon’s theorem and are capable of correcting a large number of errors
while maintaining efficiency.
Noise is an inherent part of any communication channel, whether it's thermal noise in electrical systems, interference in wireless
communications, or cosmic background radiation in deep-space transmissions. Noise introduces errors into the transmitted signal,
causing the received data to differ from the original data.
The noisy-channel coding theorem shows that as long as the data rate remains below the channel capacity, the probability of error can
be made arbitrarily small. This is a remarkable result, as it suggests that reliable communication can be achieved even over highly
noisy channels, provided the transmission rate is sufficiently limited and effective error correction codes are used.
The noisy-channel coding theorem establishes a fundamental limit on error correction performance in communication systems.
Engineers can design systems to operate close to this channel capacity by choosing suitable coding schemes and adjusting the
transmission rate. This approach minimizes error probabilities while ensuring efficient data transmission.
In modern communication systems, error correction is crucial. For example, in wireless networks (like Wi-Fi, 4G, and 5G), advanced
coding techniques such as Turbo Codes and LDPC codes are employed to correct errors caused by interference and fading. In satellite
and space communications, where retransmissions are costly, robust error correction is vital for reliable data transmission over long
distances.
A key trade-off in error correction is between redundancy and efficiency. Adding redundancy enhances error correction capabilities
but reduces the effective data rate because more bandwidth is used for redundant bits. Shannon's theorem guides system designers in
balancing this trade-off, ensuring enough redundancy is added to correct errors while maintaining efficient transmission.
For instance, in digital media storage (like CDs, DVDs, and Blu-ray), error correction codes such as Reed-Solomon are used to fix
data errors caused by scratches or imperfections.
Shannon’s noisy-channel coding theorem defines an upper limit for communication system performance, known as the Shannon limit.
Modern coding techniques, like Turbo Codes and LDPC codes, approach this theoretical limit, achieving near-optimal performance in
error correction and data throughput. These advancements have enabled highly reliable communication across various applications,
including mobile phones, satellite communications, and deep-space missions.
(OR)
Explain about the RC4 Encryption algorithm and also discuss its security implications in modern cryptographic applications.
RC4 (Rivest Cipher 4) is a stream cipher that has been used in various applications, including web security protocols like SSL/TLS
and wireless security with WEP (Wired Equivalent Privacy). However, its use in modern cryptographic applications poses serious
security concerns.
Key-Generation Algorithm
A variable-length key from 1 to 256 bytes is used to initialize a 256-byte state vector S, with elements S[0] to S[255]. For encryption
and decryption, a byte k is generated from S by selecting one of the 255 entries in a systematic fashion, then the entries in S are
permuted again.
Key-Scheduling Algorithm
We use T to produce the initial permutation of S. Starting with S[0] to S[255], and for each S[i] algorithm swap it with another byte
in S according to a scheme dictated by T[i], but S will still contain values from 0 to 255.
Once the vector S is initialized, the input key will not be used. In this step, for each S[i] algorithm swap it with another byte in S
according to a scheme dictated by the current configuration of S. After reaching S[255] the process continues, starting from S[0] again
1. Vulnerabilities to Attacks
RC4 is vulnerable to several types of attacks because of weaknesses in its key scheduling algorithm. The way RC4 generates its
keystream can lead to biases, making certain outputs more predictable. Attackers can exploit these biases to recover plaintext from
ciphertext, especially when the same keystream is reused. This predictability became apparent in 2013, leading to various attacks that
showed how easy it could be to decrypt data protected by RC4.
RC4 was once popular for securing web traffic via SSL/TLS, but its vulnerabilities have led major web browsers and organizations to
stop supporting it. Attacks on RC4 highlighted how insecure it was for encrypting sensitive data. As a result, guidelines from
organizations like the Internet Engineering Task Force (IETF) now recommend against using RC4 in any modern applications.
Many regulatory frameworks and industry standards now discourage or prohibit the use of RC4. Organizations that still use it may
face compliance issues, which can lead to penalties or loss of customer trust. Standards such as PCI DSS (Payment Card Industry Data
Security Standard) and HIPAA (Health Insurance Portability and Accountability Act) require stronger encryption methods to protect
sensitive data.
Some organizations continue to use RC4 in legacy systems because it was once considered efficient and straightforward. However,
relying on such outdated methods can create significant security risks. Transitioning away from RC4 can be challenging, requiring
updates to infrastructure and software, as well as retraining staff to handle new encryption standards.
The security implications of using RC4 in modern applications are serious. Its weaknesses make it unsuitable for protecting sensitive
information. With the discovery of its vulnerabilities, the shift to stronger encryption methods like AES (Advanced Encryption
Standard) or ChaCha20 is essential. Organizations should actively move away from RC4 to enhance security, protect their data, and
align with current best practices in cryptography. This transition not only helps mitigate risks but also ensures the integrity and
confidentiality of information in today’s digital landscape.
UNIT - III
Q. No Questions
What are Asymmetric Key Ciphers? Explain how a large document or file can be encrypted by combining public-key cryptography
with symmetric cryptographic algorithms.
The asymmetric key cryptosystems provide key-pair generation (private + public key), encryption algorithms (asymmetric key
ciphers and encryption schemes like RSA-OAEP and ECIES), digital signature algorithms (like DSA, ECDSA and EdDSA) and
key exchange algorithms (like DHKE and ECDH).
A message encrypted by the public key is later decrypted by the private key. A message signed by the private key is later verified
by the public key. The public key is typically shared with everyone, while the private key is kept secret. Calculating the private key
from its corresponding public key is by design computationally infeasible.
Public-Key Cryptosystems
*QC301 (a)
Well-known public-key cryptosystems are: RSA, ECC, ElGamal, DHKE, ECDH, DSA, ECDSA, EdDSA, Schnorr signatures. Different publ
key cryptosystems may provide one or more of the following capabilities:
Key-pair generation: generate random pairs of private key + corresponding public key.
Encryption / decryption: encrypt date by public key and decrypt data by private key (often using a hybrid encryption
scheme).
Digital signatures (message authentication): sign messages by private key and verify signatures by public key.
Key-exchange algorithms: securely exchange cryptographic key between two parties over insecure channel.
The most important and most used public-key cryptosystems are RSA and ECC. Elliptic curve cryptography (ECC) is the recommended and
most preferable modern public-key cryptosystem, especially with the modern highly optimized and secure curves (like Curve25519 and
Curve448), because of smaller keys, shorter signatures and better performance.
The RSA public-key cryptosystem is based on the mathematical concept of modular exponentiation (numbers raised to a power by modulus)
along with some mathematical constructions and the integer factorization problem (which is considered to be computationally infeasible for l
enough keys).
The elliptic-curve cryptography (ECC) cryptosystem is based on the math of the on the algebraic structure of the elliptic curves over finite fie
and the elliptic curve discrete logarithm problem (ECDLP), which is considered to be computationally infeasible for large keys. ECC comes
together with the ECDSA algorithm (elliptic-curve digital signature algorithm). ECC uses smaller keys and signatures than RSA and is prefe
in most modern apps.
Asymmetric encryption is more complicated than symmetric encryption, not only because it uses public and private keys, but because
asymmetric encryption can encrypt / decrypt only small messages, which should be mapped to the underlying math of the public-key
cryptosystem. Some cryptosystems (like ECC) do not provide directly encryption primitives, so more complex schemes should be used.
In the RSA system, the input message should be transformed to big integer (e.g. using OAEP padding), while in ECC the message cannot be
directly encrypted and more complex encryption scheme is used, based on the elliptic-curve Diffie-Hellman Key Exchange (ECDH). It will b
explained in details later in this chapter. Additionally, asymmetric ciphers are significantly slower than symmetric ciphers (e.g. the RSA
encryption is 1000 times slower than AES).
To overcome the above limitations and to allow encrypting messages of any size, modern cryptography uses asymmetric encryption schem
(also known as public key encryption schemes / asymmetric encryption constructions / hybrid encryption schemes), like key encapsula
mechanisms (KEM) and integrated encrypted schemes, which combine asymmetric encryption with symmetric key ciphers.
This is how a large document or file can be encrypted by combining public-key cryptography and symmetric crypto algorithm:
In the above diagram the encrypted symmetric key is known as KEM block (encapsulated key, with public key encryption) and the encrypte
data file is known as DEM block (encapsulated data, with symmetric encryption). The encrypted message consists of these two blocks togeth
(encapsulated key + encapsulated data).
This is the corresponding decryption process (decrypt an encrypted large document using public-key cryptography and symmetric crypto
algorithm):
Integrated encryption schemes (IES) are modern public key encryption schemes, which combine symmetric ciphers, asymmetric ciphers an
key-derivation algorithms to provide secure public-key based encryption (PKE). In EIS scheme asymmetric algorithms (like RSA or ECC)
used to encrypt or encapsulate a symmetric key, used later by symmetric ciphers (like AES or ChaCha20) to encrypt the input message. Som
EIS schemes also provide message authentication.
(Or)
Discuss the structure of Simplified DES (S-DES) and explain the processes of encryption and decryption.
Simplified Data Encryption Standard (S-DES) is a simple version of the DES Algorithm, created mainly for educational purposes.
QC301 (b) It is similar to the DES algorithm but is a smaller algorithm and has fewer parameters than [Link] is a symmetric key cipher i.e. they
use the same key for both encryption and decryption.
It is a block cipher that takes a block of plain text and converts it into ciphertext. It takes a block of 8 bit.
The S-DES encryption algorithm takes an 8-bit block of plaintext (example: 10111101) and a 10-bit key as input and produces an 8-
bit block of ciphertext as output. The S-DES decryption algorithm takes an 8-bit block of ciphertext and the same 10-bit key used to
produce that ciphertext as input and produces the original 8-bit block of plaintext.
Key Generation Concept:
In the key generation algorithm, we accept the 10-bit key and convert it into two 8 bit keys.
This key is shared between both sender and receiver.
Components :
S-DES encryption involves four functions –
1. Initial permutation(IP) –
2. Complex function (fk) –
It is the combination of permutation and substitution functions. The below image represents a round of encryption and decryption.
This round is repeated twice in each encryption and decryption.
Components in fk are –
a. Expanded Permutation (EP) –
It takes a 4-bit input and converts it into an 8-bit output.
c. Permutation P4 –
3. Switch (SW) –
S1= [0,1,2,3
2,0,1,3
3,0,1,0
2,1,0,3]
For l = 0 1 0 0
row = 00 = 0, column = 10 = 2
S0 = 3 = 11
For r = 1 1 1 1
row = 11 = 3, column = 11 = 3
S1 = 3 = 11
P4 is defined as - 2 4 3 1
After P4 = 1 1 1 1
l = 1 1 0 1 and r = 1 0 1 0
On the right half, we perform expanded permutation using EP table which converts 4 bits into 8 bits. Expand permutation is defined
as –
EP(k1, k2, k3, k4) = (k4, k1, k2, k3, k2, k3, k4, k1)
After second ep = 0 1 0 1 0 1 0 1
We perform XOR operation using second key K2 with the output of expanded permutation.
Key-2 is - 0 1 0 0 0 0 1 1
(0 1 0 0 0 0 1 1) XOR (0 1 0 1 0 1 0 1) = 0 0 0 1 0 1 1 0
After XOR operation with 2nd Key = 0 0 0 1 0 1 1 0
Again we divide the output of XOR into 2 halves of 4 bit each.
l = 0 0 0 1 and r = 0 1 1 0
We take the first and fourth bit as row and the second and third bit as a column for our S boxes.
S0 = [1,0,3,2
3,2,1,0
0,2,1,3
3,1,3,2]
S1 = [0,1,2,3
2,0,1,3
3,0,1,0
2,1,0,3]
For l = 0 0 0 1
row = 01 = 1 , column = 00 = 0
S0 = 3 = 11
For r = 0 1 1 0
row = 00 = 0 , column = 11 = 3
S1 = 3 = 11
Q. No. Questions
Describe Public Key Distribution, its role in secure communications, and analyze the challenges associated with it.
Public Key Distribution is a fundamental component of secure communications, enabling encrypted data exchange and authentication
without requiring prior key sharing. It is the backbone of asymmetric cryptography, where each user has a pair of keys: a public key
for encryption and a private key for decryption. This system is widely used in securing emails, online transactions, and web
communications through protocols like Secure Sockets Layer (SSL), Transport Layer Security (TLS), and Pretty Good Privacy (PGP).
1. Public Announcement: Here the public key is broadcast to everyone. The major weakness of this method is a forgery. Anyone can
create a key claiming to be someone else and broadcast it. Until forgery is discovered can masquerade as claimed user.
2. Publicly Available Directory: In this type, the public key is stored in a public directory. Directories are trusted here, with properties
like Participant Registration, access and allow to modify values at any time, contains entries like {name, public-key}. Directories can
be accessed electronically still vulnerable to forgery or tampering.
3. Public Key Authority: It is similar to the directory but, improves security by tightening control over the distribution of keys from
the directory. It requires users to know the public key for the directory. Whenever the keys are needed, real-time access to the directory
is made by the user to obtain any desired public key securely.
4. Public Certification: This time authority provides a certificate (which binds an identity to the public key) to allow key exchange
without real-time access to the public authority each time. The certificate is accompanied by some other info such as period of validity,
rights of use, etc. All of this content is signed by the private key of the certificate authority and it can be verified by anyone possessing
the authority’s public key.
First sender and receiver both request CA for a certificate which contains a public key and other information and then they can exchange
these certificates and can start communication.
One of the primary roles of Public Key Distribution is ensuring confidentiality. When a sender encrypts a message using the recipient’s
public key, only the recipient can decrypt it using their private key. This prevents unauthorized access even if the data is intercepted.
Another key role is authentication. Digital signatures, which use public key cryptography, verify the sender's identity and ensure that
messages are not altered in transit. The recipient can validate the signature using the sender’s public key, confirming its authenticity.
Public Key Distribution also supports integrity by preventing data tampering. Cryptographic hashing combined with public key
cryptography ensures that any modifications to the message are detectable.
To securely distribute public keys, Public Key Infrastructure (PKI) is often used, relying on Certificate Authorities (CAs) to issue
digital certificates that verify the legitimacy of public keys. This prevents attackers from impersonating legitimate users.
However, key distribution presents challenges, including key authentication, scalability, and resistance to cyber threats like Man-in-
the-Middle (MITM) attacks. Secure key management, revocation mechanisms, and emerging post-quantum cryptographic techniques
help address these concerns.
Overall, Public Key Distribution is vital for establishing secure communication channels, protecting sensitive information, and ensuring
trust in digital interactions, making it a cornerstone of modern cybersecurity.
1. Authenticity of Public Keys – Ensuring that a public key belongs to the intended recipient and preventing Man-in-the-Middle
(MITM) attacks.
2. Reliance on Certificate Authorities (CAs) – The security of Public Key Infrastructure (PKI) depends on trusted CAs, which
can be compromised.
3. Scalability Issues – Managing and distributing public keys securely becomes complex as the number of users increases.
4. Key Revocation and Expiration – Ensuring that outdated or compromised keys are revoked in a timely manner to maintain
security.
5. Trust Management – Establishing a reliable mechanism to verify public keys without central authorities in decentralized
environments.
6. Man-in-the-Middle (MITM) Attacks – Attackers can intercept and replace public keys if proper authentication mechanisms
are not in place.
7. Quantum Computing Threats – Future advancements in quantum computing could break current encryption schemes,
necessitating post-quantum cryptographic solutions.
8. Storage and Distribution Overhead – Maintaining public key directories and ensuring their secure distribution requires
significant resources.
(Or)
Enumerate the fields in an X.509 certificate and outline the steps involved in the operation of the X.509 Authentication Service for
secure communication.
X.509 is a digital certificate that is built on top of a widely trusted standard known as ITU or International Telecommunication Union
X.509 standard, in which the format of PKI certificates is defined. X.509 digital certificate is a certificate-based authentication security
framework that can be used for providing secure transaction processing and private information. These are primarily used for handling
the security and identity in computer networking and internet-based communications.
*QC401 (b)
The certificate includes the elements given below:
1. Version number: It defines the X.509 version that concerns the certificate.
2. Serial number: It is the unique number that the certified authority issues.
3. Signature Algorithm Identifier: This is the algorithm that is used for signing the certificate.
4. Issuer name: Tells about the X.500 name of the certified authority which signed and created the certificate.
5. Period of Validity: It defines the period for which the certificate is valid.
6. Subject Name: Tells about the name of the user to whom this certificate has been issued.
7. Subject’s public key information: It defines the subject’s public key along with an identifier of the algorithm for which this
key is supposed to be used.
8. Extension block: This field contains additional standard information.
9. Signature: This field contains the hash code of all other fields which is encrypted by the certified authority private key.
The X.509 Authentication Service is a widely used standard for public key certification in secure communications. It defines the format
for digital certificates and the process of authentication using Public Key Infrastructure (PKI).
Once an X.509 certificate is provided to a user by the certified authority, that certificate is attached to it like an identity card. The
chances of someone stealing it or losing it are less, unlike other unsecured passwords. With the help of this analogy, it is easier to
imagine how this authentication works: the certificate is basically presented like an identity at the resource that requires authentication.
1. Certificate Issuance
● A user generates a key pair (public and private key).
● The user sends a Certificate Signing Request (CSR) to a trusted Certificate Authority (CA), including their public key and
identity details.
● The CA verifies the user’s identity and issues an X.509 digital certificate, which binds the public key to the user’s identity and
is digitally signed by the CA.
2. Certificate Distribution
● The issued certificate is stored in a directory service or directly shared with communication partners.
● Other users can retrieve the certificate to obtain the public key for secure communication.
3. Certificate Validation
● Before using a certificate, the recipient verifies its authenticity by checking:
● The CA’s digital signature on the certificate.
● The certificate’s validity period (start and expiry date).
● The certificate’s revocation status using a Certificate Revocation List (CRL) or Online Certificate Status Protocol (OCSP).
UNIT - V
Q. No Questions
Illustrate how Kerberos works for authentication in network environments, including its key components and process.
Kerberos is a network authentication protocol designed to provide secure authentication for users and services in a distributed
computing environment. It uses symmetric key cryptography and a trusted third party to authenticate users and services without sending
passwords over the network. Below is an illustration of how Kerberos works, including its key components and the authentication
process.
Components of Kerberos
QC501 (a) *
2. Principal:
○ A user or service in the Kerberos system. Each principal has a unique identity and a secret key known only to the KDC
and the principal.
3. Tickets:
○ Encrypted data structures that allow users to access services without re-entering their passwords. Tickets are valid for a
limited time.
4. Session Key:
○ A temporary key used to encrypt communications between the user and the service.
5. Client:
○ The user or application requesting access to services.
6. Server:
○ The service the client wants to access, which also needs to be authenticated.
● The user enters their credentials (username and password) on the client machine.
1. Client to AS:
○ The client sends a request to the Authentication Server (AS) for a Ticket Granting Ticket (TGT). This request includes
the user's principal name and the name of the KDC, but not the password itself.
○ The request is usually encrypted using a hash of the user's password.
2. AS to Client:
○ The AS verifies the user's credentials against its database. If the credentials are valid:
■ The AS generates a TGT and a session key.
■ The TGT contains the user's principal name, a timestamp, an expiration time, and the session key.
■ The TGT is encrypted with the TGS's secret key.
○ The AS sends the TGT and the session key back to the client.
4. TGS to Client:
○ The TGS decrypts the TGT and verifies the authenticator. If everything checks out, it generates a service ticket for the
requested service.
○ The service ticket contains the user's principal name, a session key for the service, and an expiration time. This ticket is
encrypted with the service’s secret key.
○ The TGS sends the service ticket and the session key for the service back to the client.
5. Client to Server:
○ The client sends the service ticket to the target service (server) along with another authenticator encrypted with the
session key for that service.
6. Server to Client:
○ The server decrypts the service ticket using its secret key and validates the authenticator.
○ If the ticket is valid, the server allows access to the requested service and may send a confirmation message back to the
client.
Kerberos is a robust authentication protocol that effectively manages user credentials and access to services within a network. Its use
of tickets, session keys, and a trusted third party (KDC) enhances security by ensuring that user passwords are never sent over the
network. This multi-step process not only provides a means for secure authentication but also protects against replay attacks,
eavesdropping, and other security threats, making it a vital component in secure network environments.
(OR)
One major security risk in authentication systems is replay attacks, where an attacker captures a legitimate authentication message
and reuses it to gain unauthorized access. Challenge-Response Protocols counter this by using a nonce (a randomly generated value)
or a timestamp as the challenge. Since the challenge changes with each authentication attempt, an attacker cannot reuse a previously
captured response.
Traditional password-based authentication is vulnerable to eavesdropping, where attackers intercept credentials during transmission.
CRPs enhance security by ensuring that the actual secret (password or cryptographic key) is never transmitted over the network. Instead,
only a computed response—derived from the secret key and the challenge—is sent. Even if an attacker intercepts the response, they
cannot use it to authenticate because they lack the original secret key needed to generate new valid responses.
MITM attacks occur when an attacker intercepts and manipulates communication between two parties. While CRPs reduce the risk by
ensuring that authentication messages are unique for each session, they are not inherently immune to MITM attacks. An attacker who
can modify both the challenge and response could still trick users into authenticating against a rogue system. However, mutual
authentication—where both parties verify each other’s identity using challenge-response exchanges—can strengthen defenses against
MITM attacks.
Brute-force and dictionary attacks involve systematically guessing passwords or precomputed authentication responses. Since
challenge-response mechanisms use dynamically changing inputs, attackers cannot precompute responses or use dictionary-based
techniques effectively. Moreover, many CRPs employ cryptographic hash functions or public key cryptography, which make brute-
force attempts computationally infeasible.
Phishing attacks trick users into providing authentication credentials to a fake website or service. While CRPs do not completely
eliminate phishing risks, they make it significantly harder for attackers to reuse stolen credentials. Since the response is computed
dynamically and depends on a specific challenge, a stolen response is useless for future authentication attempts. One-time passwords
(OTPs) and public-key challenge-response mechanisms (such as FIDO2/WebAuthn) provide strong protection against phishing by
ensuring that authentication is bound to a specific origin.
1. Key Management Complexity – Secure storage and management of secret keys or private keys are essential for the
effectiveness of CRPs. If an attacker gains access to the secret key, they can generate valid responses and bypass authentication.
2. Vulnerability to MITM Attacks – As mentioned earlier, without proper mutual authentication, MITM attackers could
manipulate the challenge-response exchange.
3. Scalability Issues – In large-scale environments (e.g., enterprise authentication systems), managing and distributing
cryptographic keys for challenge-response mechanisms can be complex.
4. Resistance to Quantum Computing – Some challenge-response schemes based on traditional cryptographic algorithms (e.g.,
RSA or ECC) may become vulnerable to quantum attacks in the future. Post-quantum cryptographic techniques are needed to
maintain long-term security.
Conclusion
Challenge-Response Protocols are highly effective in addressing common authentication vulnerabilities, particularly replay attacks,
eavesdropping, brute-force attacks, and phishing attempts. Their ability to generate dynamic, session-specific authentication
responses significantly enhances security over traditional password-based methods. However, they must be implemented correctly to
mitigate MITM risks and ensure secure key management. As authentication threats evolve, integrating CRPs with additional security
layers, such as multi-factor authentication (MFA), public key infrastructure (PKI), and post-quantum cryptography, will be
essential for maintaining robust authentication security.
General Instructions
(ii) For each Question, mention CO1, CO2 etc. for Course Outcomes.
Verify the COs with the Syllabus (Avl in Website) before framing the Questions.
An Either or type Question should have same CO in both (a) and (b) parts.
(iii) For each Question, mention any number from 1 to 5 for Difficulty Level
(iv) Mark with * near the [Link].... for those Questions which are framed newly and were not included
in the QRs of LAST TWO SEMESTERs. Ensure minimum 2 new updations per unit in all Parts - PartA,
PartB & PartC. Hods are requested to maintain the QRs of each semester in a common drive and the same shall
be shared to all Faculty members of their Dept. If any subject is NEW (Introduced First time) or if all the
Questions are totally new , kindly mention that on the TOP of the Question Repository.
(v) Kindly Mention NOV 2024 on the Top without fail and allot split up of marks for subdivisions.
(vii) Type the Answer Key in the same QR template across the respective [Link]....s and delete the last 3 columns