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
- Confidentiality: Ensuring data is accessible only to authorized entities.
- Integrity: Protecting data against unauthorized modification or tampering.
- 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
| Dimension | Symmetric Key Cryptography | Asymmetric Key Cryptography |
|---|---|---|
| Key Pair | Single identical shared secret key | Public Key (open) + Private Key (secret) |
| Key Management | N(N-1)/2 keys (key explosion) | 2N keys (scalable for billions of users) |
| Encryption Speed | Extremely Fast (Hardware accelerated) | Slow (Computationally heavy modular math) |
| Primary Use | Bulk data encryption (files, network traffic) | Key exchange, digital signatures, authentication |
| Prominent Algorithms | AES-256, DES, 3DES, ChaCha20 | RSA, Diffie-Hellman, ECC (Elliptic Curve) |
Cryptographic Hash Functions and the Avalanche Effect
Cryptographic Hash Function Properties
- Deterministic: Same input message always produces identical digest.
- One-Way (Pre-image Resistance): Infeasible to reverse h = H(m) to find m.
- Second Pre-image Resistance: Infeasible to find m_2 \ne m_1 such that H(m_1) = H(m_2).
- Collision Resistance: Infeasible to find any two arbitrary messages hashing to same output.
- 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
| Mode | What is Encrypted? | Header Architecture | Typical Use Case |
|---|---|---|---|
| Transport Mode | Only IP Payload (TCP/UDP + Data) | Original IP Header remains unencrypted | Host-to-Host communication on private LAN |
| Tunnel Mode | Entire Original IP Packet (Header + Data) | Wrapped in a brand-new outer IP header | Site-to-Site Gateway-to-Gateway VPN |
Types of Firewalls (Packet Filtering, Stateful Inspection, Proxy / Application Gateway)
- Packet Filtering Firewall (Stateless - Layer 3/4): Inspects source/destination IP, port, and protocol against static ACL rules. Fast, but vulnerable to spoofing.
- Stateful Inspection Firewall (Layer 3/4): Tracks state of active TCP connections in a state table, automatically permitting legitimate inbound response traffic.
- 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:
- Choose two distinct prime numbers p and q.
- Compute modulus n = p × q.
- Compute Euler's totient \phi(n) = (p - 1)(q - 1).
- Choose public exponent e such that 1 < e < \phi(n) and \gcd(e, \phi(n)) = 1.
- Compute private exponent d such that d × e \equiv 1 \pmod{\phi(n)} (Modular Multiplicative Inverse).
- Public Key: (e, n) | Private Key: (d, n).
- Encryption: C = M^e \pmod n.
- 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
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:
- Attacker Darth intercepts Alice's public A and sends his own D_1 to Bob.
- Attacker intercepts Bob's public B and sends his own D_2 to Alice.
- Alice establishes key K_1 with Darth; Bob establishes key K_2 with Darth.
- 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
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.
100% left on this page — finishing it closes the gap for Network Security, Cryptography & Secure Protocols.
Network Security, Cryptography & Secure Protocols still counts as a weak topic until you finish this note and answer its questions.
Practise this unitTest Your Understanding
Now that you've read through these notes, practice unit MCQs to identify weak points and solidify your learning before exams.