Cyber Security MCQs - Public Key Cryptography: RSA, DH, ElGamal, ECC (Set 3)

Cyber Security MCQs - Public Key Cryptography: RSA, DH, ElGamal, ECC (Set 3) - CodingHumans

This set focuses on asymmetric cryptography: the mathematics behind RSA (Euler's totient, modular inverses and key generation), Diffie-Hellman key exchange and its man-in-the-middle weakness, ElGamal encryption, elliptic curve basics and the key distribution problem. Several small numerical problems mirror what appears in university semester papers, GATE and UGC NET, and the conceptual questions help with security and backend interview rounds.

How to practise: read each question and tap the option you think is correct. You will see right away whether you got it, along with a short explanation, and your score is tracked at the bottom of the screen. This set has 18 questions.

Cyber Security MCQ series: Set 1 | Set 2 | Set 3 | Set 4 | Set 5 | Set 6

Topics covered in this set

  • Symmetric vs asymmetric key counts
  • RSA key generation, encryption and decryption
  • Euler's totient and modular inverse
  • Diffie-Hellman key exchange and MITM
  • ElGamal encryption properties
  • Elliptic curve cryptography basics
  • Key distribution and hybrid encryption

Cyber Security MCQs with answers and explanations

Q1. In RSA with p = 5 and q = 11, the public exponent is e = 3. What is the private exponent d?

n = p*q, phi(n) = (p-1)(q-1)
d = e^-1 mod phi(n)

a) 27

b) 13

c) 7

d) 31

Q2. With the same RSA keys (n = 55, e = 3), what is the ciphertext of message M = 2?

a) 6

b) 8

c) 32

d) 53

Q3. In RSA with p = 7, q = 13, e = 5 and d = 29, a message M = 10 is encrypted. What is the ciphertext C?

C = M^e mod n

a) 10

b) 50

c) 82

d) 29

Q4. The security of RSA rests primarily on the presumed difficulty of:

a) Computing discrete logarithms in a finite field

b) Finding collisions in a hash function

c) Solving the elliptic curve discrete logarithm problem

d) Factoring the product of two large primes

Q5. In Diffie-Hellman with prime p = 23 and generator g = 5, Alice chooses a = 6 and Bob chooses b = 15. What is the shared secret key?

A = g^a mod p, B = g^b mod p
K = B^a mod p = A^b mod p

a) 8

b) 2

c) 19

d) 13

Q6. Basic (unauthenticated) Diffie-Hellman key exchange is vulnerable to which attack?

a) Man-in-the-middle attack

b) Birthday attack

c) Padding oracle attack

d) Known-plaintext attack on the shared key

Q7. For a network of 10 users, how many keys are needed in total if every pair communicates using a unique symmetric key, compared with each user holding one public-private key pair (counting public and private keys separately)?

a) 90 symmetric keys versus 10 asymmetric keys

b) 45 symmetric keys versus 10 asymmetric keys

c) 100 symmetric keys versus 20 asymmetric keys

d) 45 symmetric keys versus 20 asymmetric keys

Q8. What is Euler's totient phi(35)?

a) 34

b) 12

c) 24

d) 30

Q9. In practice, RSA is rarely used to encrypt bulk data directly. Instead, systems typically:

a) Use RSA or another public key method to exchange a symmetric session key, then encrypt data with AES

b) Encrypt each byte separately with RSA

c) Use RSA only for compressing data

d) Encrypt data with the receiver's private key

Q10. ElGamal encryption is described as 'probabilistic'. What does this mean?

a) Decryption succeeds only with high probability

b) The key is chosen by a probabilistic primality test

c) Encrypting the same message twice with the same public key normally yields different ciphertexts

d) Ciphertext length is random

Q11. In ElGamal over p = 23 with g = 5, the receiver's private key is x = 6 (public y = 8). A sender uses random k = 3 to encrypt M = 10. What is the ciphertext pair (C1, C2)?

C1 = g^k mod p
C2 = M * y^k mod p

a) (8, 10)

b) (10, 14)

c) (14, 10)

d) (10, 8)

Q12. Which point lies on the elliptic curve y^2 = x^3 + 2x + 3 over the field mod 7?

a) (1, 2)

b) (0, 3)

c) (4, 4)

d) (2, 1)

Q13. Why does ECC provide comparable security to RSA with much smaller keys (for example, about 256-bit ECC versus 3072-bit RSA)?

a) ECC uses symmetric keys internally

b) ECC keys are compressed before use

c) The best known attacks on the elliptic curve discrete log problem are fully exponential, unlike sub-exponential factoring algorithms

d) Elliptic curves are defined only over very large integers

Q14. To create a digital signature in RSA, the signer uses:

a) The receiver's public key

b) Their own public key

c) The receiver's private key

d) Their own private key

Q15. In textbook RSA with n = 33, e = 3 and d = 7, the signature on message M = 4 is:

S = M^d mod n

a) 16

b) 4

c) 31

d) 12

Q16. Textbook (unpadded) RSA is insecure in practice partly because it is deterministic and malleable. Which scheme is commonly used to fix this for encryption?

a) ECB mode

b) OAEP padding

c) PKCS#7 padding for block ciphers

d) Base64 encoding

Q17. Which of these choices of public exponent e is INVALID for RSA with phi(n) = 40?

a) e = 3

b) e = 7

c) e = 11

d) e = 5

Q18. Ephemeral Diffie-Hellman (DHE/ECDHE) in TLS is valued mainly because it provides:

a) Faster bulk encryption than AES

b) Forward secrecy, so past sessions stay safe even if the server's long-term key is later compromised

c) Elimination of the need for certificates

d) Compression of handshake messages

Quick revision notes

  • Symmetric pairwise keys: n(n-1)/2; public key: n key pairs (2n keys).
  • RSA: n = pq, phi(n) = (p-1)(q-1), choose e with gcd(e, phi) = 1, d = e^-1 mod phi.
  • Encrypt C = M^e mod n; decrypt M = C^d mod n; sign S = M^d mod n.
  • Diffie-Hellman: K = g^ab mod p; needs authentication against MITM.
  • ElGamal: C1 = g^k, C2 = M*y^k mod p; probabilistic, ciphertext doubles in size.
  • ECC: security from ECDLP; 256-bit ECC ~ 3072-bit RSA ~ 128-bit symmetric.
  • Hybrid encryption: public key for key exchange, symmetric cipher for bulk data.

Frequently asked questions

How do you find the private key d in RSA?

Compute phi(n) = (p-1)(q-1) and find d such that e*d = 1 mod phi(n), usually with the extended Euclidean algorithm. For example, with phi(n) = 40 and e = 3, d = 27 because 81 leaves remainder 1 when divided by 40.

Is Diffie-Hellman an encryption algorithm?

No. Diffie-Hellman is a key agreement protocol that lets two parties derive a shared secret over a public channel. The shared secret is then used to derive keys for a symmetric cipher such as AES.

Why is ECC preferred on mobile and IoT devices?

ECC achieves the same security as RSA with much shorter keys, which means smaller certificates, less bandwidth and faster operations. This matters on devices with limited power, memory and processing capacity.

Comments

Answered 0/0Correct 0