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

Cryptographic & Network Security - Unit -IV Notes

The document discusses hash functions, their advantages and disadvantages, and their applications in cybersecurity. It explains the importance of message authentication, including its methods, advantages, and disadvantages, as well as the use of Message Authentication Codes (MACs) and digital signatures. Additionally, it covers cryptographic hash functions like MD5, SHA-1, SHA-2, and SHA-3, highlighting their features, security levels, and examples.

Uploaded by

sahilshukla0506
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views20 pages

Cryptographic & Network Security - Unit -IV Notes

The document discusses hash functions, their advantages and disadvantages, and their applications in cybersecurity. It explains the importance of message authentication, including its methods, advantages, and disadvantages, as well as the use of Message Authentication Codes (MACs) and digital signatures. Additionally, it covers cryptographic hash functions like MD5, SHA-1, SHA-2, and SHA-3, highlighting their features, security levels, and examples.

Uploaded by

sahilshukla0506
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

[Link].

Cyber Security – (Part -1) - Sem -2


Cryptographic & Network Security
Unit - IV
Q -1) Explain the hash functions with advantages and disadvantage.
Ans: A hash function is a mathematical algorithm that converts an input of any size, such as a
message, file, or password, into a fixed-length output called a hash value or message digest. It is
widely used in computer science and cybersecurity to ensure data integrity, support authentication,
and securely store sensitive information like passwords. A key property of a hash function is that
the same input always produces the same hash, while even a small change in the input results in a
completely different hash value. This makes it easy to detect any alteration in data during storage
or transmission.

Hash functions are designed to be one-way, meaning it is computationally infeasible to retrieve the
original input from the hash value. They are also collision-resistant, making it difficult for two
different inputs to generate the same hash. While older algorithms such as MD5 and SHA-1 are
now considered insecure due to vulnerabilities, modern hash functions like SHA-256 and SHA-3
provide stronger security. Overall, hash functions are essential in modern digital systems for
maintaining data security, integrity, and trust.

Advantages of Hash Functions


1. Data Integrity: Hash functions help verify that data has not been altered during transmission
or storage.
2. Security: Since hash functions are one-way, they protect sensitive data like passwords.
3. Fast Computation: Hash values can be generated quickly, making them efficient for large
datasets.
4. Fixed Output Size: Regardless of input size, the hash output has a fixed length, simplifying
storage and comparison.
5. Authentication Support: Used in digital signatures and message authentication codes
(MACs).

Disadvantages of Hash Functions


1. Collisions: Two different inputs may produce the same hash value, which can weaken
security.
2. Not Reversible: While this is a security feature, it also means lost original data cannot be
recovered.
3. Vulnerable Algorithms: Older hash functions like MD5 and SHA-1 are no longer secure
against modern attacks.
4. No Encryption: Hash functions do not encrypt data; they only generate a digest, so they
cannot be used for confidentiality.
5. Brute-Force Attacks: Weak or unsalted hashes can be cracked using brute-force or
dictionary attacks.

-
Diagram: Advantages & Disadvantages of Hash Function

Q -2) Explain the hash functions with application and example.


Ans: A hash function is a mathematical algorithm that transforms an input of any size—such as a
message, file, or password—into a fixed-length output known as a hash value or message digest.
No matter how large or small the input data is, the resulting hash always has a constant length,
which makes storage and comparison efficient. One important property of a hash function is
determinism, meaning the same input will always generate the same hash value. At the same time,
hash functions exhibit the avalanche effect, where even a slight change in the input, such as
modifying a single character, produces a completely different hash value. This feature makes it easy
to detect any accidental or intentional changes to data.

Hash functions are also designed to be one-way, which means it is computationally infeasible to
reverse the hash and obtain the original input. This one-way nature makes hash functions highly
suitable for protecting sensitive information, especially passwords, as the original data is never
stored or transmitted. In addition, good hash functions are collision-resistant, ensuring that it is
extremely difficult for two different inputs to produce the same hash value. Due to these properties,
hash functions are widely used in computer science and cybersecurity for purposes such as data
integrity verification, secure authentication, digital signatures, and protecting information in
modern computing systems.

Applications of Hash Functions

1. Password Storage
Instead of storing passwords in plain text, systems store the hash of the password. During
login, the entered password is hashed and compared with the stored hash, improving
security.

Example: Password: Secure@123 → Hash (SHA-256): 6b3a55e0261b0304143f805a249e9f1a...

2. Data Integrity Verification


Hash functions are used to verify that data has not been altered during transmission or
storage. Any modification in the data will change the hash value

Example: File hash before transfer: 5d41402abc4b2a76b9719d911017c592


File hash after transfer (changed): 7d793037a0760186574b0282f2f435e7
3. Digital Signatures
Hash functions are used along with encryption algorithms to create digital signatures,
ensuring authenticity and integrity of messages and documents.

Example: Document → Hash: 9c56cc51b374c3ba189210d5b6d4bf57 → Encrypted with sender’s private key

4. File Integrity Checking


Software downloads often provide hash values (like SHA-256) so users can verify that the
downloaded file is original and untampered.

Example: Website-provided SHA-256 hash: 3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420a3d45e23a0b65

5. Message Authentication
Hash functions are used in Message Authentication Codes (MACs) to confirm that a
message comes from a trusted sender.

Example: Message + Secret Key → MAC: f7bc83f430538424b13298e6aa6fb143

Diagram: Applications of Hash Function

Q -3) Explain the Message Authentication with advantages and disadvantages.


Ans: Message authentication is a security mechanism used to ensure that a message is genuine and
trustworthy. It verifies that the message has been sent by a legitimate and authorized sender and
that the content of the message has not been modified, either accidentally or maliciously, while in
transit. By providing both authentication and integrity, message authentication helps protect
communication systems from threats such as impersonation, message tampering, and data forgery.

In practice, message authentication is implemented using cryptographic techniques such as


Message Authentication Codes (MACs), keyed hash functions, and digital signatures. In MAC-
based systems, the sender uses a secret key along with the message to generate an authentication
code, which is sent along with the message. The receiver, who possesses the same secret key,
recalculates the authentication code and compares it with the received one to verify authenticity and
integrity. In public-key systems, digital signatures are used, where the sender signs the hash of the
message using a private key, and the receiver verifies it using the sender’s public key. These
methods ensure secure and reliable communication, especially in applications like secure emails,
online banking, and network security protocols.
Advantages of Message Authentication
1. Ensures Message Integrity
Message authentication helps detect any unauthorized modification of the message during
transmission. If the message is altered, the authentication verification fails.
2. Verifies Sender Authenticity
It confirms that the message originates from a trusted sender, preventing impersonation and
spoofing attacks.
3. Protection Against Attacks
Message authentication protects against attacks such as message tampering, replay attacks,
and data forgery.
4. Efficient and Fast
Techniques like MACs are computationally efficient and suitable for real-time
communication systems.
5. Widely Used in Secure Communications
Message authentication is an essential component of secure protocols such as SSL/TLS,
secure emails, and online transactions.

Disadvantages of Message Authentication


1. Key Management Issues
In symmetric methods like MACs, both sender and receiver must share a secret key, which
can be difficult to manage securely.
2. No Confidentiality
Message authentication alone does not encrypt the message; it only verifies authenticity and
integrity.
3. Scalability Problems
In systems with many users, managing shared keys between each pair of users becomes
complex.
4. Vulnerable to Key Compromise
If the secret key is exposed, attackers can generate valid authentication codes for fake
messages.
5. Computational Overhead
Digital signature–based authentication can be computationally expensive compared to
symmetric-key methods.

Diagram: Advantages & Disadvantages of Message Authentication


Q -4) Explain the message authentication with application and example .
Ans: Message authentication is a vital security mechanism used in communication systems to
ensure that a message is genuine, reliable, and trustworthy. It confirms that the message has been
sent by a legitimate and authorized sender and that the data has not been modified, either
intentionally by an attacker or accidentally during transmission. By providing authentication, it
verifies the identity of the sender, and by ensuring integrity, it guarantees that the message content
received is exactly the same as what was originally sent. This protection helps prevent attacks such
as impersonation, message tampering, replay attacks, and data forgery.

Message authentication is commonly implemented using cryptographic techniques such as Message


Authentication Codes (MACs), keyed hash functions, and digital signatures. In MAC-based
systems, the sender generates an authentication code by combining the message with a secret key,
and the receiver uses the same key to verify the code. Keyed hash functions work similarly by
applying a hash algorithm along with a secret key to ensure security. Digital signatures use public-
key cryptography, where the sender signs the message using a private key and the receiver verifies
it using the sender’s public key. These methods are widely used in secure applications such as online
banking, secure emails, e-commerce transactions, and network security protocols to ensure safe and
reliable communication.

Diagram: Applications of Message Authentication

Applications of Message Authentication:


1. Secure Network Communication
Message authentication is used in network protocols such as SSL/TLS and IPsec to ensure
that data exchanged between clients and servers is authentic and untampered.
2. Online Banking and E-Commerce
In online transactions, message authentication ensures that payment details and transaction
data are not modified and are sent by legitimate users.
3. Email Security
Digital signatures are used in secure email systems to authenticate the sender and verify the
integrity of email messages.
4. Wireless and Mobile Communication
Message authentication protects data transmitted over wireless networks from spoofing and
replay attacks.
5. Software and Firmware Updates
Authentication codes verify that updates come from trusted sources and have not been
altered by attackers.
Example: Message Authentication Using Digital Signature
In secure email communication:
1. The sender creates a hash of the email message.
2. This hash is encrypted using the sender’s private key to form a digital signature.
3. The email and digital signature are sent to the receiver.
4. The receiver decrypts the signature using the sender’s public key and compares it with the
hash of the received message.
If both hashes match, the sender is authenticated and the message integrity is verified.

Q -5) Explain the MD5 (Message-Digest Algorithm 5) with their process and
example.
Ans: MD5 (Message-Digest Algorithm 5) is a cryptographic hash function created by Ronald
Rivest in 1991. In simple terms, MD5 works like a digital fingerprint for data. It takes any kind
of input—such as a message, password, or file, no matter how big or small—and converts it into a
fixed-length 128-bit hash value. This hash value is usually shown as a 32-character hexadecimal
string, which makes it easy to store and compare.

One important feature of MD5 is that it is deterministic, meaning the same input will always give
the same output. At the same time, it shows the avalanche effect: even a tiny change in the input,
like changing one letter or adding a space, produces a completely different hash. Because of this,
MD5 is very good at quickly checking whether data has been changed. MD5 is also a one-way
function, so once a hash is created, it is practically impossible to reverse it to find the original data.

In the past, MD5 was very popular because it is fast, simple, and efficient. It was commonly used
for tasks such as storing passwords securely, verifying file integrity, and supporting digital
signatures. However, as technology improved, security experts found that MD5 has serious
weaknesses, especially collision attacks, where two different inputs can generate the same hash
value. Due to these security flaws, MD5 is no longer safe for modern cryptographic security.
Today, it is mainly used only for basic integrity checks or legacy systems, while stronger hash
algorithms like SHA-256 are preferred for secure applications.

Diagram: MD5 (Message-Digest Algorithm 5)

Example of MD5

Suppose a user wants to check whether a message has been changed.

Input Message:
When this message is passed through the MD5 algorithm, it produces a fixed-length hash value:

MD5 Hash Output:

Now, if the message is changed slightly:

Input Message:

The new MD5 hash becomes:

MD5 Hash Output:

The new MD5 hash becomes:

MD5 Hash Output:

Even though only one character (!) was added, the hash value changes completely. This clearly
shows the avalanche effect of MD5, where a small change in input results in a totally different
output.

Q -6) Differentiate between SHA-1, SHA-2 ,SHA-3 (secure hash algorithm) with
example.
Ans:
Feature SHA-1 SHA-2 SHA-3
Secure Hash Secure Hash Secure Hash
Full Form
Algorithm-1 Algorithm-2 Algorithm-3
Developed By NSA (1995) NSA (2001) NIST (2015)
224, 256, 384, 512 224, 256, 384, 512
Output Size 160 bits
bits bits
Internal Design Merkle–Damgård Merkle–Damgård Sponge construction
Weak (collision Very strong, resistant
Security Level Strong and secure
attacks found) to future attacks
Slightly slower than
Speed Faster than SHA-2 Fast and efficient
SHA-2
Used in high-security
Current Usage Deprecated Widely used
systems

SHA-1 (Secure Hash Algorithm-1)

 SHA-1 was developed by the NSA in 1995 and produces a 160-bit hash value.
 It follows the Merkle–Damgård construction.
 Earlier, it was widely used for data integrity and digital signatures.
 However, collision attacks have been discovered, making it insecure today.
 Hence, SHA-1 is deprecated and no longer recommended for security use.

SHA-1 Example:

Input:

SHA-1 Hash:

SHA-2 (Secure Hash Algorithm-2)

 SHA-2 was introduced in 2001 as an improved version of SHA-1.


 It supports multiple hash sizes such as SHA-224, SHA-256, SHA-384, and SHA-512.
 SHA-2 provides strong security and resistance to collisions.
 It is widely used in SSL/TLS, digital certificates, and blockchain systems.
 Currently, SHA-2 is considered secure and reliable.

SHA-2 (SHA-256) Example:

Input:

SHA-256 Hash:

SHA-3 (Secure Hash Algorithm-3)


 SHA-3 was standardized by NIST in 2015 as a backup to SHA-2.
 It uses a sponge construction, which is different from SHA-1 and SHA-2.
 SHA-3 offers high resistance to cryptographic attacks.
 It supports the same output sizes as SHA-2 (224–512 bits).
 SHA-3 is used in high-security and future-proof cryptographic systems.

SHA-3 (SHA3-256) Example:

Input:

SHA3-256 Hash:

Q -7) Explain the MAC (message authentication code) with their process and
example.
Ans: A Message Authentication Code (MAC) is a cryptographic method used to make sure that
a message is genuine and has not been altered while being sent from one person or system to
another. In simple terms, a MAC acts like a digital seal attached to a message. When the receiver
gets the message, this seal helps confirm two important things: first, that the message really came
from the expected sender, and second, that the contents of the message remain exactly the same as
when it was sent.

A MAC is created by combining the actual message with a secret key that is shared only between
the sender and the receiver. This secret key plays a crucial role in security—because only the
authorized parties know it, no outsider can successfully create or modify a message with a valid
MAC. Even if an attacker intercepts the message, they cannot change it or forge a new one without
knowing the secret key. Any small change in the message will result in a completely different MAC,
immediately alerting the receiver to possible tampering. Because of these properties, MACs are
widely used in secure communications, online banking, network protocols, and data
transmission systems where trust and integrity are critical. While a MAC does not hide or encrypt
the message content, it provides strong assurance that the message is authentic, trustworthy, and
intact, making it an essential tool in modern cryptography and cybersecurity.
Diagram: MAC (Message Authentication Code)

Process of Message Authentication Code (MAC)


1. Shared Secret Key
The sender and receiver first agree on a secret key known only to them. This key is the
foundation of MAC security.

2. MAC Generation
The sender uses a MAC algorithm (such as HMAC) along with the secret key to generate a MAC
value from the message.

3. Message Transmission
The sender sends the message together with its MAC to the receiver.

4. MAC Verification
The receiver uses the same secret key and algorithm to recompute the MAC from the received
message.

5. Authentication Decision
If both MAC values match, the message is accepted as authentic and unchanged; otherwise, it is
rejected.

Example of Message Authentication Code (MAC)


Suppose two users, Alice (sender) and Bob (receiver) want to communicate securely and they
share a secret key in advance.

Secret Key:

Message:

MAC Generation (using HMAC-SHA256):

Alice sends the message along with the MAC to Bob.

When Bob receives it, he uses the same secret key (secure123) and the same MAC algorithm
to compute a new MAC from the received message.
 If the newly generated MAC matches the received MAC, Bob knows the message is
authentic and unaltered.
 If the MAC does not match, the message is rejected as tampered or fake.

This example shows how a MAC ensures authentication and data integrity during
communication

Q -8) Differentiate between HMAC and CMAC with example.


Ans:
Feature HMAC (Hash-based MAC) CMAC (Cipher-based MAC)
CMAC stands for Cipher-based
HMAC stands for Hash-based Message
Message Authentication Code,
Authentication Code, which uses a hash
which uses a symmetric block cipher
Full Form function combined with a secret key to
like AES along with a secret key to
provide message authentication and
generate a secure authentication
integrity.
code.
HMAC relies on cryptographic hash CMAC uses a block cipher
functions such as SHA-1, SHA-256, or algorithm, typically AES, to encrypt
Underlying
SHA-512 to process the message along blocks of the message along with a
Algorithm
with a secret key and generate a fixed- secret key and produce a secure
length hash output. MAC output.
CMAC also requires a single secret
HMAC requires a single secret key shared
key shared between the
Key between the sender and receiver to ensure
communicating parties, which is
Requirement the authenticity and integrity of the
used as the encryption key in the
message.
block cipher operations.
CMAC can also handle messages of
HMAC can process messages of any
any length, but the message is
Message length, as the hash function internally
divided into fixed-size blocks
Length handles padding and divides the message
matching the cipher’s block size, and
into blocks.
padding is applied if needed.
CMAC uses padding schemes
HMAC uses the padding mechanism specific to the block cipher, often
Padding defined by the underlying hash function, adding zero bits or a 1 followed by
Method which ensures that the message fits into the zeros to fill the final block if the
hash function’s block structure. message length is not a multiple of
the block size.
HMAC’s security depends on the strength
CMAC’s security is determined by
of the underlying hash function, and it is
Security the strength of the underlying block
resistant to attacks like length-extension
Strength cipher and provides strong resistance
and collision attacks when a strong hash is
against forgery and replay attacks.
used.
HMAC is generally faster and more CMAC is more efficient in
efficient in software implementations, hardware implementations, such
Performance especially on computers and servers, as embedded devices and smart
because hash functions are optimized for cards, where block cipher operations
software. like AES are already implemented.
CMAC is resistant to forgery attacks
HMAC provides strong security and is
and provides strong integrity
Resistance to resistant to length-extension attacks,
verification, making it ideal for
Attacks making it suitable for internet protocols,
embedded systems, IoT devices, and
APIs, and cloud services.
smart cards.

Example of HMAC (Hash-based MAC)


Shared Secret Key:

Message:

HMAC Generation (using HMAC-SHA256):

The sender sends the message + HMAC to the receiver.


The receiver uses the same secret key and SHA-256 algorithm to recompute the HMAC.
If both HMAC values match, the message is authentic and unchanged.

Real-life use: API authentication, HTTPS, cloud services.

Example of CMAC (Cipher-based MAC)


Shared Secret Key (AES key):

Message:

CMAC Generation (using AES-CMAC):


The sender sends the message + CMAC to the receiver.
The receiver uses the same AES key to generate a new CMAC.
If both CMAC values match, the message is accepted as valid and untampered.

Real-life use: Smart cards, IoT devices, embedded systems.

Q -9) Differentiate between cryptography and steganography with example.


Ans:
Feature Cryptography Steganography
Cryptography is the science of Steganography is the technique of
transforming readable information hiding the existence of a secret
(plaintext) into an unreadable form message within another non-secret
Definition
(ciphertext) using encryption techniques medium (like an image, audio, or
to ensure confidentiality, integrity, and video) so that no one suspects that a
authentication. message exists.
The main purpose of steganography is
The main purpose of cryptography is to to hide the very existence of the
Purpose secure the content of the message from message, so that outsiders do not even
unauthorized access or tampering. realize a secret communication is
taking place.
In steganography, the message is
In cryptography, the message is
Visibility of completely hidden within another
transformed into ciphertext, so it is visible
Message medium, so no one can see or detect it
but unreadable to unauthorized users.
without proper extraction.
Steganography relies on cover
Cryptography relies on encryption mediums and embedding
Security
algorithms and keys (symmetric or techniques, such as least significant
Method
asymmetric) to secure messages. bit (LSB) modification in images or
audio.
Primary Focuses on making the content Focuses on concealing the fact that a
Focus unreadable to unauthorized users. message exists at all.
Cryptography is vulnerable to Steganography is vulnerable to
Attack
cryptanalysis, where attackers try to steganalysis, where attackers try to
Detection
break the encryption. detect the hidden message.
Used in secure communication systems Used in covert communications,
Applications like SSL/TLS, VPNs, digital signatures, watermarking, digital forensics, and
and online banking. copyright protection.
Steganography is often combined with
Cryptography can be used alone to protect cryptography for double security,
Combination
data. hiding an encrypted message inside a
cover medium.
Example of Cryptography
Plaintext Message:

Using an encryption algorithm (for example, AES):

Ciphertext:

The encrypted message is visible, but no one can understand its meaning without the secret key.
Only the authorized receiver can decrypt it back into readable form.

Real-life use: Online banking, secure emails, HTTPS communication.

Example of Steganography
Cover Image:

Hidden Message:

The message is secretly embedded inside the image using a technique like LSB (Least
Significant Bit) modification.
To everyone else, the image looks completely normal and harmless, and no one suspects a secret
message exists.

Real-life use: Covert communication, digital watermarking, copyright protection.

Q-10. Differentiate between substitution techniques and transposition techniques


with example.
Ans:
Feature Substitution Technique Transposition Technique
Substitution is a cryptographic Transposition is a cryptographic
technique where each element of the technique where the positions of the
plaintext (letter, digit, or block) is characters in the plaintext are
Definition
replaced with another symbol, letter, rearranged according to a specific
or number according to a specific rule pattern or key without changing the
or key. actual characters.
Substitution changes the identity of the Transposition keeps the characters
Method characters while keeping their order the same but changes their
the same. positions in the ciphertext.
Focuses on shuffling the order of
Focuses on altering the symbols or
Focus symbols or letters to hide the
letters to hide the message.
message.
Produces a monoalphabetic or Produces a permutation cipher,
Cipher Type polyalphabetic cipher, e.g., Caesar e.g., Rail Fence cipher, Columnar
cipher, Vigenère cipher. transposition.
Vulnerable to frequency analysis if Generally more resistant to
Security Level monoalphabetic; polyalphabetic frequency analysis, but patterns can
substitutions are stronger. still be detected if key length is short.
Plaintext: HELLO → Ciphertext:
Encryption Plaintext: HELLO → Ciphertext:
LEHOL (rearranged letters using
Example IFMMP (Caesar cipher, shift +1)
transposition)
Decryption involves reversing the Decryption involves reversing the
Decryption
substitution rule using the key. position changes using the key.
Slightly more complex than
Easy to implement but may be weaker
substitution but can provide stronger
Ease of Use against attacks if simple substitution is
confusion when combined with
used.
substitution.
Used in block ciphers, data
Used in classical ciphers and simple
Applications scrambling, and secure
encryption methods in digital systems.
communication protocols.
Often combined with transposition Often combined with substitution
Combination techniques in modern ciphers for techniques in modern ciphers for
stronger encryption (e.g., DES). enhanced security.

Example of Substitution Technique


In substitution, each letter of the plaintext is replaced by another letter according to a rule.

Caesar Cipher Example


Plaintext:

Key:

Encryption:

 H→I
 E→F
 L→M
 L→M
 O→P

Ciphertext:

Here, the identity of the letters is changed, but their positions remain the same.

Example of Transposition Technique


In transposition, the letters remain the same, but their positions are rearranged.

Simple Transposition Example


Plaintext:

Rearrangement Pattern:

Reordered Letters:

Ciphertext:

Here, no letter is replaced; only the order of characters is changed.

Key Difference Shown by Example:

 Substitution: Changes letters → HELLO → IFMMP


 Transposition: Changes positions → HELLO → LEHOL
Q-11. Explain the digital signatures with their process and example.
Ans: A digital signature is a specialized cryptographic technique that provides a way to securely
verify the authenticity, integrity, and origin of a digital message or document. Unlike a simple
handwritten signature, which can be easily forged or copied, a digital signature is mathematically
generated using public-key (asymmetric) cryptography, making it extremely secure and nearly
impossible to forge. It ensures authentication, meaning the recipient can be confident that the
message was actually sent by the claimed sender. It also guarantees integrity, because any change
or tampering with the message during transmission will result in a signature mismatch, alerting the
recipient to possible alterations.

Additionally, digital signatures provide non-repudiation, which prevents the sender from denying
that they sent the message, since the signature can only be generated using the sender’s private key.
This is especially important in legal, financial, and official communications, where proof of origin
and trust is critical. Digital signatures are widely used in secure email communication, software
distribution, e-commerce transactions, and blockchain systems, where verifying the sender’s
identity and message authenticity is essential. Overall, digital signatures act as a digital equivalent
of a personal signature or seal but with far greater security and reliability, protecting both the sender
and the receiver.

Process of Digital Signatures


1. Hashing the Message
o The sender first generates a hash (message digest) of the original message using a
cryptographic hash function like SHA-256.
o This ensures a fixed-length, unique representation of the message content.
2. Encrypting the Hash
o The sender encrypts the hash using their private key to create the digital signature.
o This signature is unique to both the message and the sender’s private key.
3. Sending the Message
o The sender sends the original message along with the digital signature to the
receiver.
4. Verifying the Signature
o The receiver first generates a hash of the received message using the same hash
function.
o The receiver then decrypts the digital signature using the sender’s public key to
obtain the sender’s hash.
o If both hashes match, the message is verified as authentic and unchanged. If not, the
message may have been altered or forged.
Diagram: Process of Digital Signatures

Q-12. Explain the protocols and authentication protocols with their types and
examples.
Ans: Protocols: A protocol is a set of rules, standards, or procedures that defines how data is
transmitted, received, and interpreted between devices in a network. Protocols ensure that
communication between computers, servers, and other networked devices is reliable, organized, and
understandable, regardless of the hardware or software used.

 Protocols determine how data is formatted, transmitted, compressed, and error-


checked.
 They are essential for enabling interoperability between different devices and systems.
 Protocols can operate at different layers of the OSI model, such as the application,
transport, network, or data link layers.

Examples of Protocols:
1. HTTP/HTTPS – Hypertext Transfer Protocol for web communication.
2. FTP – File Transfer Protocol for transferring files between systems.
3. SMTP – Simple Mail Transfer Protocol for sending emails.
4. TCP/IP – Transmission Control Protocol/Internet Protocol for reliable network
communication.
5. DNS – Domain Name System protocol for translating domain names into IP addresses.

Types of Protocols
1. Application Layer Protocols
These protocols allow users and applications to communicate over a network. They define how data is requested
and delivered to end users.
Examples: HTTP, HTTPS, FTP, SMTP, POP3, IMAP, DNS

2. Transport Layer Protocols


These protocols manage end-to-end communication, ensuring data is delivered correctly and in
order. They also handle flow control and error recovery.
Examples: TCP, UDP
3. Network Layer Protocols
These protocols are responsible for logical addressing and routing of data packets between
different networks.
Examples: IP (IPv4, IPv6), ICMP, IPsec

4. Data Link Layer Protocols


These protocols control node-to-node data transfer and handle error detection at the physical
layer.
Examples: Ethernet, ARP, PPP

5. Security Protocols
These protocols ensure confidentiality, integrity, and authentication of data during
transmission.
Examples: SSL/TLS, HTTPS, SSH, IPsec

6. Routing Protocols
Routing protocols help routers select the best path for data to travel across a network.
Examples: RIP, OSPF, BGP

7. Management Protocols
These protocols are used for network monitoring, management, and troubleshooting.
Examples: SNMP, ICMP

Protocols work together across different OSI layers to ensure secure, reliable, and efficient
communication

Authentication Protocols: An authentication protocol is a type of network protocol designed to


verify the identity of a user, device, or system before granting access to a network, service, or
resource. These protocols help prevent unauthorized access, impersonation, and data breaches.

 They ensure that only legitimate users or devices can access resources.
 Authentication protocols may use passwords, cryptographic keys, digital certificates, or
tokens.
 They often combine with encryption to maintain confidentiality and integrity during
authentication.

Types of Authentication Protocols


1. Password-Based Authentication Protocols
o Users provide a username and password for verification.
o The server checks the password against stored credentials.
o Example: PAP (Password Authentication Protocol) – sends passwords in
plaintext; simple but insecure.
2. Challenge-Response Authentication Protocols
o The server sends a challenge (random value) to the client.
o The client computes a response using a secret key or password and sends it back.
o The server verifies the response.
o Example: CHAP (Challenge-Handshake Authentication Protocol) – uses hashing
to protect the password during authentication.
3. Token-Based Authentication Protocols
o Users receive a token after successful login, which is then used to access resources
without sending passwords again.
o Tokens are time-limited and can include cryptographic signatures.
o Example: OAuth 2.0 – widely used in web applications and APIs.
4. Certificate-Based Authentication Protocols
o Uses digital certificates issued by a trusted Certificate Authority (CA) to
authenticate users or devices.
o Often used in TLS/SSL connections for secure websites.
o Example: TLS Authentication – verifies servers and optionally clients using X.509
certificates.
5. Biometric Authentication Protocols
o Verifies users based on physical or behavioral characteristics, such as fingerprints,
facial recognition, or voice.
o Often combined with other protocols for multi-factor authentication (MFA).
o Example: Fingerprint authentication in mobile devices combined with password
protocols.

*-*-*-*-*-*

You might also like