Prepare for the AP Computer Science Exam. Study with flashcards and multiple choice questions, each question has hints and explanations. Get ready for your exam!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which method allows two parties to agree on a key without directly sharing it?

  1. Symmetric encryption

  2. Diffie-Hellman-Merkle method

  3. Public key infrastructure

  4. Message authentication code

The correct answer is: Diffie-Hellman-Merkle method

The Diffie-Hellman-Merkle method is a cryptographic technique that enables two parties to securely agree on a shared secret key, which can then be used for symmetric encryption. This method is particularly significant because it allows the parties to establish a secure connection without directly exchanging the key itself over the communication channel, which could be intercepted by an attacker. The process involves each party selecting a private key that remains confidential and then generating a public key that can be shared. By exchanging these public keys and performing a mathematical operation using their own private keys, both parties can end up with the same shared secret key. This effectively prevents eavesdroppers from deriving the key, even if they observe the public communication. While symmetric encryption is crucial for securing communications, it relies on the pre-existence of a shared key. Public key infrastructure involves the use of pairs of keys (public and private) for secure communication, but it does not specifically describe the method of key exchange without prior sharing. A message authentication code is used for verifying the integrity and authenticity of a message but does not pertain to key generation or sharing. Hence, the Diffie-Hellman-Merkle method stands out as the correct choice for enabling two parties to agree on a key