Cyber Security MCQs - Hash Functions, MAC, Digital Signatures and PKI (Set 4)

Cyber Security MCQs - Hash Functions, MAC, Digital Signatures and PKI (Set 4) - CodingHumans

This set covers the integrity and authentication side of cryptography: properties of cryptographic hash functions, MD5 and the SHA family, the birthday attack, message authentication codes and HMAC, digital signature schemes such as RSA signatures and DSA, and public key infrastructure including X.509 certificates, certificate authorities, chains of trust and revocation. It supports university exams, GATE and UGC NET revision and security interviews.

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

  • Preimage, second preimage and collision resistance
  • MD5, SHA-1, SHA-2 and SHA-3
  • Birthday paradox and collision attacks
  • MAC vs hash vs digital signature
  • HMAC construction
  • X.509 certificates, CA and chain of trust
  • CRL and OCSP revocation

Cyber Security MCQs with answers and explanations

Q1. Which hash function property means it is computationally infeasible to find ANY two distinct inputs with the same hash?

a) Collision resistance

b) Preimage resistance

c) Second preimage resistance

d) Avalanche effect

Q2. For an ideal n-bit hash function, roughly how much work does a generic birthday attack need to find a collision?

a) 2^n hash computations

b) 2^(n/2) hash computations

c) n^2 hash computations

d) 2^(n-1) hash computations

Q3. What is the output size of MD5, and approximately how many operations would a generic birthday attack need on it?

a) 160 bits; about 2^80

b) 128 bits; about 2^128

c) 128 bits; about 2^64

d) 256 bits; about 2^128

Q4. In a room of how many people does the probability that two share a birthday first exceed 50% (365-day year)?

a) 183

b) 57

c) 366

d) 23

Q5. Which of these hash functions produces a 160-bit digest and is now considered broken for collision resistance?

a) SHA-256

b) SHA-1

c) SHA3-256

d) SHA-512

Q6. SHA-3 (Keccak) differs structurally from SHA-2 because it is based on:

a) A sponge construction

b) The Merkle-Damgard construction

c) A Feistel network

d) The RSA problem

Q7. A message authentication code (MAC) provides integrity and authentication, but NOT non-repudiation. Why?

a) MACs do not use any key

b) MACs are always shorter than hashes

c) MACs can be verified by anyone with a public key

d) Both sender and receiver share the same secret key, so either could have produced the MAC

Q8. HMAC is computed as shown. What are ipad and opad?

HMAC(K, m) = H((K' XOR opad) || H((K' XOR ipad) || m))

a) Random nonces chosen per message

b) The first and last blocks of the message

c) Fixed constant byte patterns (0x36 and 0x5C repeated) XORed with the padded key

d) Public keys of sender and receiver

Q9. Why is the naive construction MAC = H(K || m) with SHA-256 considered insecure?

a) It is vulnerable to length-extension attacks

b) SHA-256 is not collision resistant

c) The key is revealed in the output

d) It cannot handle messages longer than one block

Q10. In a typical digital signature scheme, what is actually signed with the private key?

a) The entire message encrypted with AES

b) The receiver's public key

c) A hash of the message

d) The certificate revocation list

Q11. Which security services does a digital signature provide?

a) Confidentiality only

b) Authentication, integrity and non-repudiation

c) Confidentiality and availability

d) Availability and access control

Q12. In DSA or ECDSA, what is the consequence of reusing the same per-signature random value k for two different messages?

a) The signatures become unverifiable

b) The signature size doubles

c) Only the hash of the message is leaked

d) The signer's private key can be computed from the two signatures

Q13. An X.509 certificate primarily binds:

a) A user's password to a username

b) A private key to a domain name, signed by the subject

c) A subject's identity to a public key, signed by an issuing CA

d) A session key to an IP address

Q14. A browser validating a website certificate verifies the certificate's signature using:

a) The website's private key

b) The browser's own private key

c) A shared symmetric key with the CA

d) The public key of the issuing (intermediate or root) CA

Q15. Which mechanism lets a client check a certificate's revocation status in real time for a single certificate, instead of downloading a full list?

a) OCSP

b) CRL

c) CSR

d) PKCS#12

Q16. Which component of a PKI verifies a requester's identity before the CA issues a certificate, without signing certificates itself?

a) Root CA

b) Registration Authority (RA)

c) Certificate Revocation List

d) Relying party

Q17. A hash function shows the avalanche effect if:

a) The output length grows with input length

b) Similar inputs give similar outputs

c) It can be reversed with a key

d) Changing one input bit changes about half of the output bits unpredictably

Q18. Passwords should be stored using a slow, salted function such as bcrypt, scrypt or Argon2 rather than plain SHA-256 mainly because:

a) SHA-256 output is too short to store

b) Fast hashes let attackers test billions of guesses per second, and salts defeat precomputed tables

c) SHA-256 is reversible

d) bcrypt encrypts passwords so they can be recovered

Quick revision notes

  • Hash properties: preimage resistance, second preimage resistance, collision resistance.
  • Birthday bound: collision in ~2^(n/2) work; 23 people give >50% shared birthday.
  • Digest sizes: MD5 128, SHA-1 160, SHA-256 256, SHA-512 512 bits.
  • SHA-2 uses Merkle-Damgard (length extension possible); SHA-3 uses sponge.
  • HMAC = H((K XOR opad) || H((K XOR ipad) || m)); ipad 0x36, opad 0x5C.
  • MAC: integrity + authentication; signature adds non-repudiation.
  • X.509 fields: version, serial, signature algorithm, issuer, validity, subject, public key, extensions.
  • Revocation: CRL (list) and OCSP (online query, can be stapled).

Frequently asked questions

What is the difference between a hash, a MAC and a digital signature?

A hash is unkeyed and only detects accidental or unauthenticated changes. A MAC uses a shared secret key to provide integrity and authentication between parties who share that key. A digital signature uses a private key, so anyone can verify it and it also provides non-repudiation.

Why is the birthday attack important for choosing hash sizes?

Because collisions can be found in about 2^(n/2) operations, a hash needs twice as many output bits as the desired security level. This is why 256-bit hashes are used for 128-bit collision security.

What is a chain of trust in PKI?

A server certificate is signed by an intermediate CA, which is signed by a root CA trusted by the operating system or browser. Verifying each signature in turn links the server's public key back to a trusted root.

Comments

Answered 0/0Correct 0