🎓 BookMCQ
← Back to 15. Security

📝 Key distribution as a Security Tool (7 MCQs)

Delivering Cryptographic Keys to Intended Parties

Key distribution is the secure process of providing cryptographic keys to the users, devices, or services that need them. It is a central part of operating system and network security because encryption is effective only when keys reach authorised parties and remain unavailable to attackers. Distribution methods include protected pre-sharing, key servers, certificates, and authenticated key exchange.

Why Secret Keys Create a Communication Challenge

Symmetric encryption requires communicating parties to possess the same secret key. Sending that key over an unprotected channel may expose future communication. Public-key systems reduce this problem but still require trustworthy public-key validation and protection of private keys. Large systems must also manage key ownership, expiry, replacement, and revocation.

Establishing and Protecting Cryptographic Keys

Parties may receive a key through a secure physical channel, a trusted key distribution centre, or an authenticated cryptographic protocol. The system verifies the identities involved, establishes or delivers the key, and stores it in protected memory or hardware. Expired or compromised keys are replaced, and affected credentials may be revoked.

Example of a Session Key Establishment

A client connects to a server using a secure protocol. The parties authenticate the server's certificate and perform an authenticated key exchange to derive a shared session key. That temporary key protects subsequent data transfers. The private keys remain protected, while the session key is discarded after its permitted use.

Confidentiality, Scalability and Key Lifecycle Risks

Secure distribution prevents unauthorised parties from obtaining encryption secrets and supports large-scale communication. Key servers improve central management but become sensitive infrastructure. Poor randomness, insecure storage, weak certificate validation, or delayed revocation can expose many sessions. Effective key management includes generation, distribution, storage, rotation, backup, expiry, and destruction.

Misconceptions About Key Distribution

'A public key must be distributed secretly' is false because authenticity, not secrecy, is its primary requirement. 'Encrypting a key automatically authenticates its owner' ignores identity verification. 'A key never needs replacement after distribution' overlooks compromise, expiry, algorithm changes, and scheduled rotation.

Exam Focus: Key Establishment and Lifecycle

Compare pre-shared keys, key distribution centres, certificates, and authenticated key exchange. Trace how two parties establish a session key and protect it from interception. Questions may examine key rotation, revocation, private-key storage, and why authentication of the communicating parties is necessary.

Key Terms of Key Distribution

  • Key distribution - Secure delivery or establishment of keys.
  • Session key - Temporary key for one connection.
  • Key server - Trusted service managing key exchange.
  • Certificate - Authenticated binding of identity and key.
  • Revocation - Withdrawal of a compromised credential.
2
Easy
3
Medium
2
Hard

📝 All Key distribution as a Security Tool MCQs

Q1. What is the primary purpose of a key distribution center (KDC) in symmetric cryptography?

A.To generate and securely deliver session keys to communicating parties ✅
B.To encrypt data transmitted over the network
C.To authenticate users via public keys
D.To store passwords in plaintext
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The KDC's main role is to create fresh symmetric session keys and transmit them securely to the two parties that will communicate. By enabling both sides to encrypt and decrypt messages without exposing the key to eavesdroppers. Options B and D describe unrelated functions, and option C refers to public‑key authentication, which is not the KDC's purpose in symmetric systems. Therefore A is correct.

Q2. Why does overwriting the return address in a stack frame allow an attacker to execute arbitrary code?

A.It changes the function's local variables
B.Control flow is redirected to the address stored in the overwritten return address ✅
C.It disables the operating system's scheduler
D.It clears the stack
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: When a function returns, the CPU fetches the address stored in the return‑address slot of the stack frame and jumps to that location. Overwriting this slot replaces the legitimate address with the address of the attacker’s shellcode, causing execution to continue at the malicious code. Changing local variables (A) does not affect control flow, disabling the scheduler (C) is unrelated, and clearing the stack (D) would crash the program. Hence B is correct.

Q3. How does a NOP sled facilitate successful execution of shellcode after a buffer overflow?

A.It encrypts the shellcode to evade detection
B.It shortens the distance to the return address
C.It provides a sequence of no‑operation instructions that slides execution into the shellcode ✅
D.It disables security checks in the operating system
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: A NOP sled is a sequence of no‑operation instructions placed before the actual shellcode. Because NOPs do nothing, the processor can slide through them until it reaches the first executable instruction of the payload. This makes the exact jump address less critical: any address that lands anywhere inside the sled will eventually reach the shellcode. Options A and D describe unrelated mechanisms, and B suggests the sled encrypts the code, which is false. Therefore C correctly explains the role of a NOP sled.

Q4. A program allocates a buffer of 64 bytes (BUFFER_SIZE = 64) on the stack. An attacker wants to overwrite the saved return address, which is located immediately after the buffer and the saved frame pointer (4 bytes). Which of the following byte counts must the attacker supply to reach the return address?

A.64
B.68
C.70
D.72 ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: The buffer occupies 64 bytes, so the attacker must first fill those bytes to reach the next stack element. Directly after the buffer the saved frame pointer consumes 4 bytes, bringing the total to 68 bytes. The following 4 bytes hold the saved return address; overwriting it requires an additional 4 bytes. Therefore the attacker must supply 68 + 4 = 72 bytes to control the return address, making option D the correct choice.

Q5. Which of the following techniques is most effective at preventing a buffer‑overflow attack that overwrites the return address?

A.Disabling user accounts ✅
B.Stack canaries
C.Increasing password length
D.Using a VPN
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The most direct way to stop an overflow that overwrites the return address is to place a known canary value just before the saved return address. At function exit the program checks whether the canary has been altered; if it has, the process aborts before using the corrupted address. Disabling accounts (A) does not affect memory safety, increasing password length (C) is unrelated, and using a VPN (D) only protects network traffic. Thus B is the effective mitigation.

Q6. Assume a 32‑bit system where the stack grows downward. The buffer starts at address 0xBFFFF00xBFFFF0 and occupies 12 bytes. The saved frame pointer is at 0xBFFFFC0xBFFFFC and the return address is at 0xBFFFF80xBFFFF8. If an attacker writes 16 bytes of data starting at the buffer, which address will the CPU use for the next return?

A.0xBFFFF80xBFFFF8 ✅
B.0xBFFFFC0xBFFFFC
C.0xBFFFF00xBFFFF0
D.0xBFFFF40xBFFFF4
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: On a 32‑bit little‑endian system the stack grows toward lower addresses. The buffer starts at 0xBFFFF00xBFFFF0 and occupies 12 bytes, so it ends at 0xBFFFFB0xBFFFFB. The next 4 bytes (at 0xBFFFFC0xBFFFFC–0xBFFFFF0xBFFFFF) hold the saved frame pointer, and the following 4 bytes (at 0xBFFFF80xBFFFF8–0xBFFFFB0xBFFFFB) contain the return address. Writing 16 bytes overwrites the buffer and the saved frame pointer, and the first four bytes of the overwritten return address are taken as the new jump target. Consequently the CPU will use the address at 0xBFFFF80xBFFFF8, making option A correct.

Q7. When designing a key‑distribution protocol for a network service that runs with elevated privileges, which design principle most directly reduces the risk of a buffer‑overflow exploit?

A.Use asymmetric encryption for all messages ✅
B.Store keys in plaintext on the server
C.Perform input validation on all parameters before copying into fixed‑size buffers
D.Rotate keys every hour
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Input validation directly limits the amount of data that can be copied into a fixed‑size buffer, preventing the overflow from ever reaching the saved return address. By checking lengths and rejecting overly long inputs, the program ensures that the memory layout remains intact, which is the most reliable way to avoid exploitation. Using asymmetric encryption (A) does not affect memory copying, storing keys in plaintext (B) creates other risks, and rotating keys (D)

🔗 Related Topics (MCQs)