LATESTSSC CGL 2026 Notification Live | ISRO Scientist 'SC' Interview Shortlists Out | NIC Scientist B Active
Join Telegram Job Alerts
InterviewJobs.in
Computer Science & IT 15 min read

Cryptography & Network Security: RSA Algorithm, Diffie-Hellman & PKI

Essential cybersecurity concepts, encryption schemes, digital certificates (X.509), and authentication protocols required for government tech officer roles.

#Security#Cryptography#RSA#Diffie Hellman#Cyber Security

In-Depth Interview Questions & Model Solutions

Q1Explain the mathematical foundation of the RSA algorithm and why finding private key d is computationally hard.

RSA relies on the mathematical difficulty of factoring the product of two large prime numbers (Prime Factorization Problem). (1) Key Generation: Choose two large distinct primes p and q. Compute n = p*q and Euler totient φ(n) = (p-1)*(q-1). Choose public exponent e such that 1 < e < φ(n) and gcd(e, φ(n)) = 1. (2) Private Key: Compute d such that (d * e) ≡ 1 (mod φ(n)) using Extended Euclidean Algorithm. Encryption: C = M^e mod n. Decryption: M = C^d mod n. An attacker knowing n and e cannot compute d without finding φ(n), which requires factoring n into p and q.

Key Technical Takeaways:
  • Security is based on integer factorization problem.
  • Key sizes: 2048-bit or 4096-bit recommended for modern security.
  • OAEP padding prevents chosen-ciphertext attacks.

Q2How does Diffie-Hellman Key Exchange establish a shared secret over an insecure channel, and how is Man-In-The-Middle (MITM) prevented?

Diffie-Hellman allows two parties to agree on a symmetric session key without transmitting the secret itself: (1) Alice and Bob publicly agree on prime p and generator g. (2) Alice picks private secret a, sends A = g^a mod p. (3) Bob picks private secret b, sends B = g^b mod p. (4) Shared secret: Alice calculates K = B^a mod p, Bob calculates K = A^b mod p (both equal g^(ab) mod p). Because raw DH lacks authentication, an active attacker can intercept and substitute keys (MITM). Mitigation: Authenticated DH using digital certificates signed by a trusted Certificate Authority (CA) or Ephemeral Diffie-Hellman with RSA/ECDSA (ECDHE).

Key Technical Takeaways:
  • Solves Discrete Logarithm Problem (DLP).
  • Ephemeral DH (DHE/ECDHE) provides Perfect Forward Secrecy (PFS).
  • Requires PKI / Digital Signature for authentication.

Technical Panel Interview Strategy Tips

  • In NIC / MeitY interviews, emphasize the difference between Hashing (one-way, e.g. SHA-256), Encryption (two-way), and Encoding (Base64).
These modules are prepared for self-study and interview revision. InterviewJobs.in is not responsible for variations in actual board questions. See our Disclaimer Policy.