摘要 |
The present invention provides a key configuration method and apparatus. The method includes: acquiring, by a first device, a public key of a second device through a secure medium; sending, by the first device, information used for obtaining a shared key to the second device; and obtaining, by the second device, a shared key by using a private key of the second device and the information that is used for obtaining a shared key, where the first device obtains the shared key by using the information used for obtaining a shared key or by using a private key of the first device. The present invention ensures that the public key of the second device reaches the first device, avoids that an attacker masquerades as the second device to establish a secure connection with the first device, so that the attacker cannot listen to a message between the first device and the second device, thereby improving security of interaction between the first device and the second device. |