Skip to content
Unit 5 Syllabus Note· Computer Networks

Computer Networks

Comprehensive exam revision notes for BCA-208N Unit 5 (Network Security, Cryptography & Secure Protocols). Includes Section A (2M), Section B (5M), and Section C (15M) questions, answers, and diagrams.

Computer Networks

Network Security, Cryptography & Secure Protocols

Core Definitions & Key Concepts

What are the three pillars of the CIA Triad in information security

  1. Confidentiality: Ensuring data is accessible only to authorized entities.
  2. Integrity: Protecting data against unauthorized modification or tampering.
  3. Availability: Ensuring network systems and resources remain accessible when needed.

Passive Attacks and Active Attacks

  • Passive Attacks: Adversary monitors or eavesdrops on communication channels without altering data (e.g., packet sniffing, traffic analysis).
  • Active Attacks: Adversary alters data streams, injects forged messages, replays packets, or disrupts system availability (e.g., DoS, MitM, IP spoofing).

What is the difference between Symmetric and Asymmetric Cryptography

  • Symmetric: Single shared secret key used for both encryption and decryption (e.g., AES, DES).
  • Asymmetric: Mathematically paired keys; Public Key encrypts, and matching Private Key decrypts (e.g., RSA, ECC).

What mathematical problem forms the basis of the RSA cryptosystem

The computational difficulty of factoring large composite integers into their two giant prime factors (N = p × q).

What is a Digital Signature, and which key is used to create it

A Digital Signature is an encrypted hash of a message created using the Sender's Private Key. Anyone with the sender's Public Key can verify authenticity, integrity, and non-repudiation.

What does a Certificate Authority (CA) do in Public Key Infrastructure (PKI)

A CA acts as a trusted third party that verifies an entity's legal identity and issues digitally signed X.509 certificates binding the entity's identity to their public key.

At which network layer does IPsec operate

IPsec operates at the Network Layer (Layer 3), securing all IP traffic transparently without requiring application modifications.

What is a Demilitarized Zone (DMZ) in network security

A dedicated subnet located between the untrusted external Internet and the private internal enterprise LAN, hosting public-facing servers (Web, Mail, DNS) to isolate core corporate assets.

Conceptual & Architectural Analysis

Compare Symmetric Key Cryptography vs Asymmetric Key Cryptography

DimensionSymmetric Key CryptographyAsymmetric Key Cryptography
Key PairSingle identical shared secret keyPublic Key (open) + Private Key (secret)
Key ManagementN(N-1)/2 keys (key explosion)2N keys (scalable for billions of users)
Encryption SpeedExtremely Fast (Hardware accelerated)Slow (Computationally heavy modular math)
Primary UseBulk data encryption (files, network traffic)Key exchange, digital signatures, authentication
Prominent AlgorithmsAES-256, DES, 3DES, ChaCha20RSA, Diffie-Hellman, ECC (Elliptic Curve)

Cryptographic Hash Functions and the Avalanche Effect

Cryptographic Hash Function Properties

  1. Deterministic: Same input message always produces identical digest.
  2. One-Way (Pre-image Resistance): Infeasible to reverse h = H(m) to find m.
  3. Second Pre-image Resistance: Infeasible to find m_2 \ne m_1 such that H(m_1) = H(m_2).
  4. Collision Resistance: Infeasible to find any two arbitrary messages hashing to same output.
  5. Avalanche Effect: Flipping a single bit in the input message completely randomizes more than 50% of the bits in the output hash digest.

Compare IPsec Transport Mode vs Tunnel Mode

ModeWhat is Encrypted?Header ArchitectureTypical Use Case
Transport ModeOnly IP Payload (TCP/UDP + Data)Original IP Header remains unencryptedHost-to-Host communication on private LAN
Tunnel ModeEntire Original IP Packet (Header + Data)Wrapped in a brand-new outer IP headerSite-to-Site Gateway-to-Gateway VPN

Types of Firewalls (Packet Filtering, Stateful Inspection, Proxy / Application Gateway)

  1. Packet Filtering Firewall (Stateless - Layer 3/4): Inspects source/destination IP, port, and protocol against static ACL rules. Fast, but vulnerable to spoofing.
  2. Stateful Inspection Firewall (Layer 3/4): Tracks state of active TCP connections in a state table, automatically permitting legitimate inbound response traffic.
  3. Application-Level Gateway (Proxy - Layer 7): Disassembles and inspects application payloads (HTTP, FTP commands) to block malicious application attacks.

In-Depth Analysis & Implementation

The RSA Public-Key Cryptographic Algorithm with Full Mathematical Steps and a Solved Example

RSA Algorithm Formulation & Derivation

Step-by-Step Mathematical Algorithm:

  1. Choose two distinct prime numbers p and q.
  2. Compute modulus n = p × q.
  3. Compute Euler's totient \phi(n) = (p - 1)(q - 1).
  4. Choose public exponent e such that 1 < e < \phi(n) and \gcd(e, \phi(n)) = 1.
  5. Compute private exponent d such that d × e \equiv 1 \pmod{\phi(n)} (Modular Multiplicative Inverse).
  6. Public Key: (e, n) | Private Key: (d, n).
  7. Encryption: C = M^e \pmod n.
  8. Decryption: M = C^d \pmod n.

Solved Numerical Example:

  • Let p = 3, q = 11.
  • Modulus n = 3 × 11 = \mathbf{33}.
  • \phi(n) = (3 - 1)(11 - 1) = 2 × 10 = \mathbf{20}.
  • Choose e = 7 (since \gcd(7, 20) = 1).
  • Compute d: (d × 7) \pmod{20} = 1 \implies 7d = 21 \implies \mathbf{d = 3}.

Test Encryption with Plaintext Message $M = 2$: $C = 2^7 \pmod{33} = 128 \pmod{33} = \mathbf{29} \quad (Ciphertext)$

Test Decryption of Ciphertext $C = 29$: $M = 29^3 \pmod{33} = 24,389 \pmod{33} = \mathbf{2} \quad (Original Message Restored!)$

Diffie-Hellman Key Exchange Algorithm and the Man-in-the-Middle (MitM) Vulnerability

Diffie-Hellman Key Exchange Protocol

System Architecture / Concept DiagramHorizontal Scroll Enabled
Alice                                                            Bob
--------------------------------------------------------------------
Agrees publicly on prime p and base g (primitive root mod p)
Chooses private secret a                                        Chooses private secret b
Computes Public A = g^a mod p -----[ Sends A publicly ]----->
                               <-----[ Sends B publicly ]----- Computes Public B = g^b mod p
Computes Shared Key:                                            Computes Shared Key:
K = B^a mod p                                                  K = A^b mod p
[ Both compute identical shared secret: K = g^(ab) mod p ]

Man-in-the-Middle (MitM) Attack:

Because basic Diffie-Hellman has no authentication:

  1. Attacker Darth intercepts Alice's public A and sends his own D_1 to Bob.
  2. Attacker intercepts Bob's public B and sends his own D_2 to Alice.
  3. Alice establishes key K_1 with Darth; Bob establishes key K_2 with Darth.
  4. Darth transparently decrypts, reads, alters, and re-encrypts all messages.
  • Defense: Must combine Diffie-Hellman with Digital Signatures or X.509 Certificates for mutual endpoint authentication.

SSL/TLS Handshake Protocol Architecture and HTTPS Security

The TLS 1.3 Handshake Protocol Architecture

System Architecture / Concept DiagramHorizontal Scroll Enabled
Client                                                      Server
  |                                                            |
  | ----- 1. ClientHello (Cipher suites, Key Share) ---------> |
  |                                                            |
  | <---- 2. ServerHello (Selected cipher, Key Share) -------- |
  | <---- 3. EncryptedExtensions ----------------------------- |
  | <---- 4. Certificate (Server X.509 Cert) ----------------- |
  | <---- 5. CertificateVerify (Digital Signature of Handshake)| 
  | <---- 6. Finished (HMAC of entire handshake) ------------- |
  |                                                            |
  | [Client verifies Server Certificate against CA Root]       |
  | [Both derive identical Symmetric AES Session Keys]         |
  |                                                            |
  | ----- 7. Finished ---------------------------------------> |
  |                                                            |
  | <==== SECURE APPLICATION DATA (AES-256-GCM / Port 443) ===>|
  • Eliminates eavesdropping and tampering for web commerce, banking, and confidential API transactions.

Important Exam Points & Quick Revision

Solve RSA numerical encryption/decryption step-by-step and draw the full TLS handshake sequence.

Your reading progress
0%

100% left on this page — finishing it closes the gap for Network Security, Cryptography & Secure Protocols.

Weak topic hint

Network Security, Cryptography & Secure Protocols still counts as a weak topic until you finish this note and answer its questions.

Practise this unit
What Should You Do Next?

Test Your Understanding

Now that you've read through these notes, practice unit MCQs to identify weak points and solidify your learning before exams.