Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make sure the public key's authenticity

I'm new to asymmetric cryptography (public-private keys) and has a fundamental confusion: I understand that once a person has broadcast his public key to the network, the following communications become safe using the public-private key paradigm. However, how do you make sure the public key received is valid at the first place? For example, if Bob wants to establish a secure communication with Alice, with Eve eavesdropping in the middle, how do you make sure that Bob receives the real public key from Alice, instead of the fake public key forged by Eve? Thanks!

Cheers, M.

like image 536
M23 Avatar asked Sep 06 '25 03:09

M23


1 Answers

Public Key Infrastructure (PKI).
You have a third-party trusted authority that issues certificates to different people/companies. You don't only trust the people, but also the Certification Authority (CA).

The Certification Authority must ensure and validate that the people/company that is buying a certificate is in fact who it claims to be.
The verification is done by signing a the certificate using a private key (from this CA), then both peers in the connection will check that the certificate was signed by a trusted CA and validate the connection.

In you example, Bob will sign the certificate in a CA that Alice trusts.
If Eve tries to sign a certificate in this CA, claiming to be Bob, this will be rejected, because the CA will validate its authenticity. Try to buy a client certificate here to see: https://www.verisign.com/

Another example is your browser, it only shows that a trusted connection is done with StackOverflow, because it trust on Let´s Encrypt, which issued the StackOverflow.com certificate.
Every browser has some default CAs that are already trusted.

like image 151
hess Avatar answered Sep 09 '25 22:09

hess