2

I understand how public key infrastructure works.

There is a private and public key, and someone may use the public key to encrypt data that can only be decrypted with the private key.

However there seems to be a flaw with this...

When you want someone, E.g Bob to send you a secret message, you send the key to him: Public key ==> Bob

Bob then encrypts the data and sends it back to me.

Data ==> Public key ==> back to me

But what happens if at the first stage Public key ==> Bob an attacker modifies the public key to one he has the private key to, then decrypts the data Bob unknowingly sends?

How is this prevented?

  • 1
    Public key cryptography (PKC) uses public and private keys as you describe. Public key infrastructure (PKI) builds on this to distribute the public keys in a secure way which does NOT consist simply of 'Public key ==> Bob' exactly to prevent substitution or alteration. So apparently you don't understand PKI all that well. The brief answer is: usually a certificate signed by a CA or web-of-trust signed keys. – dave_thompson_085 May 25 '16 at 1:09
8

Either

  • you give the public key to Bob when you physically meet him and mutually verify identities (as at a key-signing party), or

  • Bob verifies your public key through a trusted introducer (e.g. a Certification Authority)

This is the "Infrastructure" part of PKI.

  • Makes sense, thanks. So there always has to be someone at the end of the day who you just have to trust (e.g CA)? – Joseph A. May 25 '16 at 1:46
  • 1
    @JosephA. yes. Undertanding that such someone could be yourself – Ángel May 25 '16 at 1:54
  • Option three, variation on option one, Bob is a CA and his certificate is already in your root trust store. – Kevin May 25 '16 at 6:07
  • @Kevin Just wondering though, how is the transfer CA --> Bob protected against attackers? – Joseph A. Jun 5 '16 at 14:06
  • 1
    @JosephA.: Either the CA is already trusted by Bob (because its public key is built into his operating system or browser; this is called a "root CA") or the CA presents its own certificate which is signed by another CA that Bob trusts. Eventually everything chains back to a root CA. – Kevin Jun 5 '16 at 17:35
1

There are broadly two classes of methods: you deliver the public key in person (which assumes you yourself are immune from tampering in transit, of course), or you use a trustworthy intermediary to vouch for it, say, by signing a certificate — cryptographically or otherwise — or carrying it in a sealed and hopefully tamper-evident envelope.

In practice, private people interested in secure key exchange tend to come together and hold keysigning parties; there are well-established traditions for this sort of thing by now. In cryptographic literature, the metaphor commonly used for secure key material delivery is diplomatic pouch.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.