CNS Module3 Study Notes-1
CNS Module3 Study Notes-1
NETWORK SECURITY
MODULE 3
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
Introduction
Key distribution is the process of securely delivering cryptographic keys between communicating users.
In symmetric encryption, both sender and receiver use the same secret key.
In asymmetric encryption, public and private key pairs are used.
Secure key distribution is important because weak key exchange leads to complete compromise of encrypted
communication.
2. A third party can select the key and physically deliver it to A and B.
3. If A and B have previously 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.
• Session Key: Temporary key used for the duration of a logical connection and then discarded.
• Master Key: Shared by the KDC and an end system/user; used to encrypt the session key.
Step 1: A issues a request to the KDC for a session key (Ks) to protect a logical connection to B. The
message includes the identity of A (ID_A), identity of B (ID_B), and a unique nonce N1 for this
transaction. The nonce may be a timestamp, a counter, or a random number; it must differ with each
request.
Step 2: The KDC responds with a message encrypted using Ka (A's master key). Thus, A is the only
one who can successfully read the message. The message includes: (a) The one-time session key Ks,
(b) The original request message including the nonce N1, (c) E(Kb, [Ks || IDA]) — encrypted with B's
master key, intended for B.
Step 3: A stores the session key and forwards E(Kb, [Ks || IDA]) to B. Because this information is
encrypted with Kb, it is protected from eavesdropping. B now knows the session key Ks, knows that the
other party is A, and knows the information originated at the KDC.
Step 4: Using the newly minted session key Ks for encryption, B sends a nonce N2 to A.
Step 5: Also 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 was not a replay.
A→
KDC:
ID_A
Request for session key
■
ID_B
■ N1
KDC
→ A:
E(Ka,
[Ks ■
ID_A
■
Session key + ticket for B
ID_B
■ N1])
■
E(Kb,
[Ks ■
ID_A])
A → B:
E(Kb,
Forward ticket to B
[Ks ■
ID_A])
B → A:
E(Ks, Nonce for authentication
N2)
A → B:
E(Ks, Authentication confirmation
f(N2))
Advantages Limitations
• Fast communication • Efficient for large data transfer • • KDC dependency • Single point of failure • Key
Centralized key management compromise affects all communication
Step 1: A generates a public/private key pair {PUa, PRa} and transmits a message to B consisting of
PUa and an identifier of A (IDA).
Step 2: B generates a secret key Ks and transmits it to A, encrypted with A's public key: E(PUa, Ks).
Step 3: A computes D(PRa, E(PUa, Ks)) to recover the secret key. Because only A can decrypt the
message, only A and B will know the identity of Ks.
Step 4: A discards PUa and PRa and B discards PUa.
Step 5: Both users communicate using the shared session key Ks.
■ Man-in-the-Middle Attack: Here a third party can intercept messages and then either relay the
intercepted message or substitute another message. Such an attack is known as a man-in-the-middle
attack.
Step 1: A uses B's public key to encrypt a message to B containing an identifier of A (IDA) and a nonce
N1: E(PUb, [N1 ■ IDA]).
Step 2: B sends a message to A encrypted with PUa containing A's nonce N1 and a new nonce N2:
E(PUa, [N1 ■ N2]). Because only B could have decrypted message (1), the presence of N1 assures A
that the correspondent is B.
Step 3: A returns N2 encrypted using B's public key: E(PUb, N2), to assure B that its correspondent is
A.
Step 4: A selects a secret key Ks and sends M = E(PUb, E(PRa, Ks)) to B. Encryption with B's public
key ensures only B can read it; encryption with A's private key ensures only A could have sent it.
Step 5: B computes D(PUa, D(PRb, M)) to recover the secret key.
A Hybrid Scheme: Yet another way to use public-key encryption to distribute secret keys is a hybrid
approach.
• This scheme retains the use of a key distribution center (KDC) that shares a secret master key with each
user and distributes secret session keys encrypted with the master key.
• The addition of a public-key layer provides a secure, efficient means of distributing master keys.
Advantages Limitations
• Solves key distribution problem • Better scalability • • Slower than symmetric systems • Computational
Supports secure communication over Internet • Secure overhead • Vulnerable to man-in-the-middle attack
key exchange without shared secret without authentication
Conclusion: Symmetric key distribution using symmetric and asymmetric encryption ensures secure session
establishment and protected communication.
Key Terms: Session key • KDC • Public key • Private key • Key distribution • Secure communication
Reference:
Introduction
A cryptographic hash function converts data of arbitrary size into a fixed-size hash value called a
message digest. It is mainly used for integrity verification, authentication, and digital signatures. Hashing is
one-way and irreversible.
Hash Function
2. One-Way Property (Pre-image Original message cannot be reconstructed from the hash value.
Resistance) Given h(M) = H, it is computationally infeasible to find M.
3. Collision Resistance Difficult to find two different messages M1 and M2 such that
h(M1) = h(M2).
5. Efficient Computation Easy and fast to compute h(M) for any given message M.
3. Digital Signatures Message digest is signed instead of the full message, saving
computational effort.
Conclusion: Cryptographic hash functions provide integrity, authentication, and efficient verification for
secure communication systems.
Key Terms: Message digest • Collision resistance • Avalanche effect • Integrity • One-way function
Reference:
Introduction
Hash functions generate fixed-size message digests from variable-length input messages. Two commonly
used sample hash functions are: 1. MD5 and 2. SHA-512.
Limitation: Vulnerable to collision attacks — MD5 is no longer considered secure for cryptographic
purposes.
2. SHA-512 Algorithm
SHA-512 belongs to the SHA-2 family and produces a 512-bit message digest. It is designed by NIST and
is widely used for strong security applications.
Rounds 64 80
Conclusion: MD5 and SHA-512 are widely used hash algorithms, but SHA-512 provides significantly
stronger security.
Key Terms: Message digest • Padding • Compression function • Collision resistance • 128-bit •
512-bit
■ Memory Trick: MD5 = Old and Weak | SHA = Strong and Modern
Reference:
Introduction
Kerberos is a trusted third-party network authentication protocol designed to provide secure authentication
over insecure networks using symmetric key cryptography.
Kerberos uses: Authentication Server (AS) | Ticket Granting Server (TGS) | Session keys | Tickets
Components of Kerberos
Component Function
Ticket Granting Ticket (TGT) Special ticket issued by AS for accessing TGS
→
Authentication Server (AS) (2) TGT + Session Key■ [encrypted with user key]
↓
Client sends TGT to TGS (3) TGT + Service Request
→
Ticket Granting Server
(4) Service Ticket + Session Key■
(TGS)
↓
Client sends Service Ticket (5) Service Ticket
→
Service/Application Server (6) Authentication Success → Service Granted
Step 2: Authentication Request Client sends a request to the Authentication Server (AS): Client → AS:
to AS ID_client ■ ID_TGS ■ TS1. (TS = Timestamp)
Step 3: AS Response AS verifies the user exists in the database and sends: (a) A Ticket
Granting Ticket (TGT) encrypted with TGS's secret key, (b) A session
key K_c,tgs encrypted using the client's secret key. Client decrypts
using its password-derived key to obtain K_c,tgs.
Step 4: Request to TGS Client sends TGT and an authenticator to the Ticket Granting Server:
Client → TGS: ID_service ■ Ticket_tgs ■ Authenticator_c
Step 5: TGS Response TGS decrypts TGT, verifies authenticator, and sends: (a) A Service
Ticket encrypted with the service's secret key, (b) A new session key
K_c,s for client-server communication.
Step 6: Access Service Server Client presents the service ticket and a new authenticator: Client →
Server: Ticket_service ■ Authenticator_c
Step 7: Mutual Authentication The server verifies the ticket and authenticator, then optionally sends
back a timestamp to prove its identity. Service is then granted. Both
sides have confirmed each other's identity.
Mutual Authentication Both client and server verify each other's identity.
Password Never Transmitted Secret key derived from password locally; never sent over network.
Replay Attack Protection Timestamps and nonces prevent reuse of old messages.
Single Sign-On (SSO) One login provides access to multiple services without
re-authentication.
Secure Ticket Mechanism Tickets are encrypted and cannot be forged by attackers.
Advantages Limitations
• Strong authentication • Centralized security • Time synchronization required (clocks must be within
management • Secure distributed systems • Prevents 5 minutes) • Single point of failure if KDC goes down •
password exposure • Supports single sign-on Complex implementation • Password compromise
affects all tickets
Applications: Windows Active Directory, Enterprise authentication, Distributed systems, Secure network
login
Key Terms: Authentication Server (AS) • Ticket Granting Server (TGS) • Session key • Ticket • Mutual
authentication • Replay protection
■ Confusing AS and TGS roles — AS authenticates the user; TGS issues service tickets
■ Forgetting ticket flow — AS → TGT → TGS → Service Ticket → Server
■ Writing public-key cryptography instead of symmetric key cryptography for Kerberos
Reference:
Introduction
X.509 is an international standard for public-key digital certificates used in authentication systems and
secure communication. Certificates are issued and verified by a Certificate Authority (CA). X.509
certificates are used in most network security applications, including IP security, SSL, SET, and S/MIME.
Certificate Authority (CA) issuing certificates to Users A and B [Source: CNS_Module_3.pdf, Page 25]
Field Description
Validity Period Start date (Not Before) and expiry date (Not After)
Public Key Information Owner's public key and the algorithm used
1. Any participant can read a certificate to determine the name and public key of the certificate's owner.
2. Any participant can verify that the certificate originated from the certificate authority and is not counterfeit.
4. Any participant can verify the currency of the certificate (i.e., it has not expired or been revoked).
Advantages Limitations
Applications: SSL/TLS, Secure email (S/MIME), VPNs, IP security, E-commerce systems, Secure
Electronic Transactions (SET)
Key Terms: Certificate Authority • Public key certificate • Digital signature • Validity period •
Authentication • X.509
■ Forgetting certificate fields — know all 8 fields (Version, Serial, Signature Algorithm, Issuer, Validity,
Subject, Public Key, Signature)
■ Confusing issuer and subject — Issuer is the CA; Subject is the certificate owner
■ Memory Trick: CA signs → Users trust (The CA's signature is what makes a certificate valid)
Reference:
Introduction
Public key distribution is the process of securely sharing public keys among users in public-key cryptography
systems. Improper distribution can lead to: Impersonation, Fake public keys, and Man-in-the-middle
attacks.
Several techniques have been proposed for the distribution of public keys, which can mostly be grouped into
four categories:
Figure 10.1 — Uncontrolled Public Key Distribution (Public Announcement) [Source: CNS_Module_3.pdf, Page 20]
Major Weakness (Limitation): Vulnerable to forgery — anyone could pretend to be user A and send a fake
public key. Until the forgery is discovered, attackers can masquerade as the claimed user.
• A participant may replace the existing key with a new one at any time (e.g., if the private key is
compromised).
• Participants can access the directory electronically. Secure, authenticated communication from the
authority to the participant is mandatory.
Figure 10.2 — Public Key Directory (Public Key Publication) [Source: CNS_Module_3.pdf, Page 21]
Advantages: Centralized management | Better reliability | More secure than public announcement
Limitations: If an adversary obtains the private key of the directory authority, they can pass out counterfeit
public keys and impersonate any participant. Tampering with directory records is also a risk.
Msg 1 A → Authority: Request ■ Time■ A sends timestamped request for B's public key
Msg 2 Authority → A: E(PRauth, [PU_b ■ Request Authority returns B's public key, signed with
■ Time■]) PRauth
Msg 3 A → B: E(PU_b, [ID_A ■ N1]) A stores B's key and sends encrypted message
with nonce N1
Msg 5 Authority → B: E(PRauth, [PU_a ■ Request Authority returns A's public key signed
■ Time■])
Msg 6 B → A: E(PU_a, [N1 ■ N2]) B sends N1+N2 encrypted with A's public key —
proves identity
Limitations: Communication overhead (7 messages required) | Authority dependency | Bottleneck for large
networks
Certificate Authority (CA) — Certificate Exchange between Users A and B [Source: CNS_Module_3.pdf, Page 25]
Each party extracts the other's public key by decrypting with PUauth.
Conclusion: Public key distribution techniques ensure secure and authenticated sharing of public keys in
asymmetric cryptographic systems.
Key Terms: Public key authority • Certificate Authority • Public directory • Authentication •
Man-in-the-middle
■ Confusing public key authority and certificate authority — PKA distributes keys in real-time; CA issues
certificates offline
■ Forgetting that certificates are the most secure and widely deployed method
■ Memory Trick: Certificates = Most Secure (No real-time authority contact needed)
Reference:
Introduction
Public-key cryptography requires secure distribution of public keys to avoid: Impersonation, Fake public
keys, and Man-in-the-middle attacks. Four general categories are used for distributing public keys
securely.
1. Public Announcement → 2. Publicly Available Directory → 3. Public Key Authority → 4. Public Key
Certificates
Advantages Limitations
• Simple implementation • Easy public access • Vulnerable to forgery — fake public keys possible •
Anyone can masquerade as another user
Advantages Limitations
• Centralized management • Better reliability • More • Directory protection required • Tampering risk if
secure than announcement directory is compromised • Requires secure,
authenticated access
Advantages Limitations
• High security • Prevents fake keys • Real-time • Communication overhead (7 messages) • Authority
verification dependency — bottleneck • Real-time contact required
always
Conclusion: The four general categories of public key distribution provide different levels of security and
management for secure public-key communication.
Key Terms: Public Key Authority • Certificate Authority • Public directory • Digital certificate •
Authentication
■ Confusing public directory and public key authority — Directory is a database; PKA is an online trusted
server
■ Forgetting certificates are most secure — they eliminate real-time authority dependency
Reference:
Introduction
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. Decentralized key
distribution distributes cryptographic key management responsibilities across multiple users/end systems
instead of relying on one central authority.
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 communicate in a secure manner with
all potential partner end systems for purposes of session key distribution.
Thus, there may need to be as many as n(n−1)/2 master keys for a configuration with n end systems.
Figure 14.5 — Decentralized Key Distribution (Initiator A and Responder B) [Source: CNS_Module_3.pdf, Page 14]
Step 1: A issues a request to B for a session key and includes a nonce N1: A → B: ID_A ■ N1
Step 2: B responds with a message encrypted using the shared master key K_m. The response
includes: (a) the session key Ks selected by B, (b) an identifier of B (ID_B), (c) the value f(N1) — proves
Step 3: Using the new session key Ks, A returns f(N2) to B: A → B: E(Ks, f(N2)). This confirms to B that
A has successfully received and decrypted the session key.
Components Table
Component Function
End System (A or B) Acts as both key requester and key generator; no central KDC needed
Session Key (Ks) Temporary key generated by B for this specific communication session
Nonce (N1, N2) Random values used to prevent replay attacks and confirm freshness
f(N1), f(N2) Transformed nonce values (e.g., +1) used for mutual authentication
Key Count n master keys (user to KDC) n(n-1)/2 master keys (pairwise)
Trust Required KDC must be trusted Each pair manages own trust
Practicality Better for large networks Suitable for small local networks
• PIN-encrypting key: For personal identification numbers (PINs) used in electronic funds transfer and
point-of-sale applications.
Control Vector: A more flexible scheme for key usage control. Each session key has an associated control
vector consisting of fields that specify the uses and restrictions for that session key.
The session key is recovered by the reverse operation: D([K_m ⊕ H], E([K_m ⊕ H], Ks))
Figure 14.6 — Control Vector Encryption and Decryption [Source: CNS_Module_3.pdf, Page 17]
Advantages Limitations
• Better scalability • Reduced workload on single server • Complex management • n(n-1)/2 master keys
• Improved reliability • Faster local authentication • required • Synchronization issues between systems •
Eliminates KDC as single point of failure Not practical for very large networks
Applications: Enterprise networks, Distributed systems, Cloud security, Small local networks
Conclusion: Decentralized key distribution eliminates the single point of failure of centralized KDC while
maintaining security, though it requires significantly more master keys for larger networks.
Key Terms: Decentralized • Master key • Session key • Nonce • End system • n(n-1)/2
■ Forgetting that n(n-1)/2 master keys are needed for n end systems in fully decentralized distribution
■ Saying decentralized is better for all networks — it is only practical for small local networks
■ Memory Trick: Decentralized = Each pair shares a master key | n users → n(n-1)/2 keys
Reference: