Diffie-Hellman & Man-in-the-Middle
- 20Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What primary security vulnerability does Diffie-Hellman, when used alone, face?
What primary security vulnerability does Diffie-Hellman, when used alone, face?
20 questions
- 1
What primary security vulnerability does Diffie-Hellman, when used alone, face?
- A
It fails to ensure the confidentiality of shared parameters.
- B
It is vulnerable to denial-of-service attempts.
- C
It is susceptible to brute-force attacks on private keys.
- D
It lacks protection against man-in-the-middle attacks.
Correct answer
DIt lacks protection against man-in-the-middle attacks.
Explanation
Diffie-Hellman on its own does not provide any protection from someone sitting in the middle and intercepting messages, making man-in-the-middle attacks a significant problem.
- A
- 2
What is the primary role of RSA or public key encryption in conjunction with Diffie-Hellman?
- A
To encrypt the entire communication content directly.
- B
To provide authentication and prevent man-in-the-middle attacks.
- C
To increase the speed of the key exchange process significantly.
- D
To establish a shared secret key without public parameters.
Correct answer
BTo provide authentication and prevent man-in-the-middle attacks.
Explanation
RSA or public key encryption is brought in to help address the man-in-the-middle problem by providing authentication, ensuring that the parties communicating are who they claim to be.
- A
- 3
Which two public parameters are typically shared between Alice and Bob in a Diffie-Hellman exchange?
- A
A large prime number 'n' and a private value 'a'.
- B
Two distinct private values 'a' and 'b'.
- C
A generator 'g' and a large prime number 'n'.
- D
A generator 'g' and a private value 'b'.
Correct answer
CA generator 'g' and a large prime number 'n'.
Explanation
Alice and Bob already have some shared parameters: a generator 'g' and a large prime number 'n', which are used in the calculation of the shared key.
- A
- 4
What does Alice send to Bob in the initial public exchange of a Diffie-Hellman key agreement?
- A
A random number 's' generated by her client.
- B
The value of 'g' to the power of 'a' modulo 'n'.
- C
The calculated shared secret 'g' to the power of 'ab'.
- D
Her private value 'a' directly to Bob's server.
Correct answer
BThe value of 'g' to the power of 'a' modulo 'n'.
Explanation
Alice calculates 'g' to the power of 'a' modulo 'n' (simplified to 'g' to the power of 'a' in the text) and sends this value to Bob as part of the public exchange.
- A
- 5
What is the final shared secret calculated by both Alice and Bob in a Diffie-Hellman exchange?
- A
The generator 'g' raised to the power of 'ab' modulo 'n'.
- B
The generator 'g' raised to the power of their private values.
- C
A public key 'k_private' shared between them.
- D
The product of their private values 'a' and 'b' modulo 'n'.
Correct answer
AThe generator 'g' raised to the power of 'ab' modulo 'n'.
Explanation
Both Alice and Bob use the publicly exchanged values and their own private values to calculate 'g' to the power of 'ab' modulo 'n', which is their shared secret.
- A
- 6
In a man-in-the-middle attack on Diffie-Hellman, what does Shawn do with Alice's initial message?
- A
He signs it with Bob's public key before sending it on.
- B
He intercepts it, stops it, and pretends to be Bob to Alice.
- C
He forwards it directly to Bob without any alterations.
- D
He decrypts it using his own private key and then re-encrypts.
Correct answer
BHe intercepts it, stops it, and pretends to be Bob to Alice.
Explanation
Shawn intercepts Alice's message, stops it, and then pretends to be Bob from that point onward, initiating a separate key exchange with Alice.
- A
- 7
What does Shawn send to Alice in response to her initial Diffie-Hellman parameter?
- A
A hash of Alice's 'g' to the power of 'a' value.
- B
Bob's actual 'g' to the power of 'b' value.
- C
His own 'g' to the power of 's' value, pretending to be Bob.
- D
His own generated private key 's'.
Correct answer
CHis own 'g' to the power of 's' value, pretending to be Bob.
Explanation
Shawn generates his own private key 's', calculates 'g' to the power of 's', and sends this value back to Alice, making her believe it is 'g' to the power of 'b' from Bob.
- A
- 8
After the man-in-the-middle attack, what shared secret does Shawn establish with Alice?
- A
The original generator 'g' and prime 'n' values.
- B
The legitimate shared secret 'g' to the power of 'ab'.
- C
A key based on Bob's private key 'b' and his own 's'.
- D
A shared secret derived from 'g' to the power of 'as'.
Correct answer
DA shared secret derived from 'g' to the power of 'as'.
Explanation
Shawn, using his private key 's' and Alice's 'g' to the power of 'a', calculates a shared secret 'g' to the power of 'as' with Alice.
- A
- 9
What shared secret does Shawn establish with Bob during a man-in-the-middle attack?
- A
A pre-shared key 'k_public' provided by the server.
- B
Bob's original private key 'b' which is then used for encryption.
- C
The same shared secret 'g' to the power of 'as' that he has with Alice.
- D
A shared secret derived from 'g' to the power of 'sb' using his own key.
Correct answer
DA shared secret derived from 'g' to the power of 'sb' using his own key.
Explanation
Shawn then communicates with Bob, sending his 'g' to the power of 's' (pretending to be Alice), and establishes a shared secret 'g' to the power of 'sb' with Bob.
- A
- 10
How does Shawn exploit the two shared secrets he establishes with Alice and Bob?
- A
He uses them to prevent any further communication between them.
- B
He shares them publicly to demonstrate the protocol's weakness.
- C
He uses them to generate a new, more secure third key.
- D
He decrypts messages from one, re-encrypts, and sends to the other.
Correct answer
DHe decrypts messages from one, re-encrypts, and sends to the other.
Explanation
Shawn, having established two separate shared secrets, can decrypt messages from Alice with 'g' to the power of 'as', re-encrypt them with 'g' to the power of 'sb', and send them to Bob, thus acting as a man-in-the-middle.
- A
- 11
What additional information does Bob send to Alice along with 'g' to the power of 'b' to prevent man-in-the-middle attacks?
- A
A separate public key generated by Alice.
- B
A confirmation code received from a third party.
- C
His private key to Alice for direct authentication.
- D
A digital signature of his message signed with his private key.
Correct answer
DA digital signature of his message signed with his private key.
Explanation
Bob sends 'g' to the power of 'b' along with a digital signature (e.g., a hash of 'g' to the power of 'b' signed with his private key) to ensure Alice knows only he could have sent it.
- A
- 12
What process does Alice perform to verify Bob's identity when he sends a digitally signed message?
- A
She asks Bob to provide a verbal confirmation of his identity.
- B
She compares the signed message with a pre-shared secret value.
- C
She decrypts the entire message using her own private key.
- D
She performs a signature verification using Bob's public key.
Correct answer
DShe performs a signature verification using Bob's public key.
Explanation
Alice performs a signature verification: she applies Bob's public key to the encrypted signature and compares it to a hash of the original message to ensure they match.
- A
- 13
What does a match in signature verification confirm for Alice regarding Bob's message?
- A
That the message has not been altered in transit.
- B
That the message contains the correct Diffie-Hellman parameters.
- C
That only Bob, possessing the private key, could have sent it.
- D
That the message was encrypted using her public key.
Correct answer
CThat only Bob, possessing the private key, could have sent it.
Explanation
If the signature verification matches, Alice knows that only Bob, who holds the corresponding private key, could have created that signature, thereby authenticating his identity.
- A
- 14
Which internet protocols commonly incorporate Diffie-Hellman combined with RSA for key exchanges?
- A
IKE for VPNs and TLS for HTTPS connections.
- B
SMTP and POP3 for email communication.
- C
DNS and DHCP for network configuration.
- D
HTTP and FTP for secure file transfers.
Correct answer
AIKE for VPNs and TLS for HTTPS connections.
Explanation
The combination of Diffie-Hellman and RSA is a fundamental part of numerous internet key exchanges, including the IKE protocol used in VPNs and the handshake in TLS (HTTPS).
- A
- 15
Why is Diffie-Hellman often preferred over solely using RSA for establishing shared secrets in protocols like TLS?
- A
Diffie-Hellman offers perfect forward secrecy.
- B
RSA provides superior protection against all types of attacks.
- C
RSA cannot be used to generate symmetric keys at all.
- D
Diffie-Hellman is generally much faster for bulk encryption.
Correct answer
ADiffie-Hellman offers perfect forward secrecy.
Explanation
Diffie-Hellman offers 'perfect forward secrecy'. If an RSA key is compromised, past communications encrypted with keys derived solely from that RSA key could be decrypted. Diffie-Hellman generates ephemeral keys per session, limiting the impact of a future compromise.
- A
- 16
What is the consequence if an RSA key used for all encryption is ever broken or compromised?
- A
The Diffie-Hellman parameters will also instantly be compromised.
- B
The symmetric keys will remain secure due to their length.
- C
All historical messages encrypted with that key could be decrypted.
- D
Only future communications will be affected and compromised.
Correct answer
CAll historical messages encrypted with that key could be decrypted.
Explanation
If only RSA were used and its key broken, anyone who had recorded past messages could then decrypt every single historic message because the same key was used to encrypt the shared symmetric key for all sessions.
- A
- 17
What does the term 'ephemeral' mean in the context of Diffie-Hellman keys?
- A
They are used only for authentication, not for encryption.
- B
They are fixed values agreed upon before any communication.
- C
They are generated per session and used for a short time.
- D
They are stored for a long period, typically years, on servers.
Correct answer
CThey are generated per session and used for a short time.
Explanation
Ephemeral Diffie-Hellman keys are generated for each session and are used for a very short duration, typically only once, to establish a shared secret.
- A
- 18
How are ephemeral Diffie-Hellman keys and RSA keys typically combined in modern secure communication?
- A
Ephemeral Diffie-Hellman verifies identity, RSA generates shared secrets.
- B
Ephemeral Diffie-Hellman generates shared secrets, RSA provides authenticity.
- C
Both protocols are used to encrypt the entire message content.
- D
RSA keys are never used; only Diffie-Hellman establishes everything.
Correct answer
BEphemeral Diffie-Hellman generates shared secrets, RSA provides authenticity.
Explanation
Ephemeral Diffie-Hellman keys are used to generate the shared secret, while RSA is used to provide authenticity and ensure there isn't a man-in-the-middle.
- A
- 19
Why is RSA generally not used for long-term encryption of entire messages?
- A
RSA is computationally too slow for bulk message encryption.
- B
RSA does not offer any form of perfect forward secrecy.
- C
RSA keys are too small to encrypt large amounts of data securely.
- D
RSA cannot generate symmetric keys for efficient encryption.
Correct answer
ARSA is computationally too slow for bulk message encryption.
Explanation
RSA is too slow for encrypting entire messages. It is typically used to derive a symmetric key, which is then used by faster algorithms like AES for the actual bulk encryption.
- A
- 20
What is AES (Advanced Encryption Standard) primarily used for in conjunction with Diffie-Hellman and RSA?
- A
To establish the initial public parameters for the exchange.
- B
To perform the digital signing of messages for authentication.
- C
To provide efficient, fast symmetric encryption of message content.
- D
To generate the ephemeral Diffie-Hellman keys for each session.
Correct answer
CTo provide efficient, fast symmetric encryption of message content.
Explanation
AES, a symmetric key algorithm, is used for the actual encryption of message content because it is much faster than RSA, which is often used only for establishing the symmetric key.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.