A method for establishing a secure connection, comprising: securely obtaining, by a first device, a first public key estimated value of a second device in an out-of-band manner, wherein the first public key estimated value is a value obtained after an operation is performed based on a first key-exchange public key of the second device by using a preset algorithm (S 101); encrypting, by the first device, an asymmetric encryption public key of the first device by using the obtained first public key estimated value (S 102); sending, by the first device, the encrypted asymmetric encryption public key and second key-exchange public key information of the first device to the second device, wherein the second key-exchange public key information comprises a second key-exchange public key of the first device, and the second key-exchange public key is used by the second device to generate a shared key by using the second key-exchange public key and a key-exchange private key of the second device and establish a secure connection to the first device by using the generated shared key (S 103); receiving, by the first device, the encrypted first key-exchange public key of the second device that is sent by the second device, wherein the encrypted first key-exchange public key is obtained by the second device after the second device decrypts the received encrypted asymmetric encryption public key of the first device by using the first public key estimated value of the second device and encrypts the first key-exchange public key by using the decrypted asymmetric encryption public key of the first device (S 104); decrypting, by the first device, the encrypted first key-exchange public key by using an asymmetric encryption private key corresponding to the asymmetric encryption public key (S 105); performing, by the first device by using the preset algorithm, an operation based on the decrypted first key-exchange public key, to obtain a second public key estimated value (S 106); and when the first public key estimated value is consistent with the second public key estimated value, determining, by the first device, that the decrypted first key-exchange public key is correct, generating a shared key by using a key-exchange private key of the first device and the decrypted first key-exchange public key, and establishing a secure connection to the second device by using the shared key (S 107). securely obtaining, by a first device, a first public key estimated value of a second device in an out-of-band manner, wherein the first public key estimated value is a value obtained after an operation is performed based on a first key-exchange public key of the second device by using a preset algorithm (S 101); encrypting, by the first device, an asymmetric encryption public key of the first device by using the obtained first public key estimated value (S 102); sending, by the first device, the encrypted asymmetric encryption public key and second key-exchange public key information of the first device to the second device, wherein the second key-exchange public key information comprises a second key-exchange public key of the first device, and the second key-exchange public key is used by the second device to generate a shared key by using the second key-exchange public key and a key-exchange private key of the second device and establish a secure connection to the first device by using the generated shared key (S 103); receiving, by the first device, the encrypted first key-exchange public key of the second device that is sent by the second device, wherein the encrypted first key-exchange public key is obtained by the second device after the second device decrypts the received encrypted asymmetric encryption public key of the first device by using the first public key estimated value of the second device and encrypts the first key-exchange public key by using the decrypted asymmetric encryption public key of the first device (S 104); decrypting, by the first device, the encrypted first key-exchange public key by using an asymmetric encryption private key corresponding to the asymmetric encryption public key (S 105); performing, by the first device by using the preset algorithm, an operation based on the decrypted first key-exchange public key, to obtain a second public key estimated value (S 106); and when the first public key estimated value is consistent with the second public key estimated value, determining, by the first device, that the decrypted first key-exchange public key is correct, generating a shared key by using a key-exchange private key of the first device and the decrypted first key-exchange public key, and establishing a secure connection to the second device by using the shared key (S 107).