Public Key Distribution
As discussed in Chapter 12, "Virtual Private Networks," it is not easy to distribute the keys required to establish a secure connection. With asymmetric encryption algorithms, one of the two keys is public, as discussed in Chapter 4, "Cryptography." When public keys are exchanged, their authentication must be guaranteed, which is where PKI is useful. In asymmetric algorithms, two keys are used, one for encrypting and one for decrypting the data. With an RSA exchange, for example, Alice uses its public and private key for cryptographic operations. Alice's public key can be made public, but her private key must be kept secret. When Bob wants to send an encrypted message to Alice, he uses Alice's public key to encrypt the message. Only Alice, who has the corresponding private key, can decrypt the message.At first sight, this system looks flawless, but in actuality, obtaining someone's public key can be tricky. Is the public key you receive from another person really from that person or entity? When somebody's public key is requested, a potential attacker could intercept it and replace it with another public key. This kind of attack would cause the message sender to encrypt all messages with the attacker's public key. Therefore, a mechanism is needed to verify the relation between the public key and the person using that key. It is important to securely obtain the public key. There are two nonscalable solutions to this problem:
- Exchanging the public keys out-of-band or over a secure channel
The exchange takes place via another channel (for example, telephone or regular mail) or over a secure, already protected channel. This last approach requires the establishment of an additional secured channel between the two entities. - Exchanging the public keys over an insecure channel
In this case, the received keys have to be verified out-of-band (for example, by reading the key back over the telephone to the sending party).
Both approaches are rather cumbersome in practice and do not scale. Another problem is that public-key exchanges must be made between any two communicating parties. So if n number of parties need to communicate with each other, the number of public-key exchanges increases as n * (n - 1). Several attempts have been made to overcome this scaling problem. One of the best-known systems is Pretty Good Privacy (PGP), which is based on public-key cryptography and uses digital signing of public keys. This allows some useful features such as trusted introducing. For example:
- Alice and Bob securely exchange their public keys using one of the previously mentioned methods.
- Alice and Bill also securely exchange their public keys.
- Alice can now digitally sign Bill's public key using PGP and send it to Bob.
- Bob can verify Alice's signature. He has her public key, and he can consider Bill's public key to be authentic if he trusts Alice.