In an E2EE system, how does Alice know what Bob's public key is?

#cryptography

@ghosttie it's public, so either Bob can send it to Alice, or if it's part of a system like Signal, then the public key is part (maybe hidden /abstracted) of the user profile data.
@dacmot how does Alice know that's Bob's actual public key and not Mallory's?

@ghosttie one way would be to meet in person.

In a system like Signal, it would be built in to the user ID. For things like PGP/GPG, websites, or developer signing key, there are multiple mechanisms to verify the key identity. You can use a web of trust (WOT) or keyrings, certificate authorities like DigiCert/Let's Encrypt, or MS/Google/Apple issuing signing keys.

Note that none of those methods are perfect, and a bad actor could still manage to impersonate someone else. But it makes it significantly harder.

@dacmot @ghosttie signal also has safety numbers which should be verified outside of signal. If the safety number changes, then the keys have changed and you might not be talking with the same individual anymore.