As discussed in the previous section, the main problem with secret key encryption is that the sender and recipient must agree on a single key to lock and unlock transmitted data and this key must be kept private. In 1976, Whitfield Diffie and Martin Hellman introduced the concept of public key cryptography, a system in which the sender and recipient never exchange secret keys. The public key is published, while the private key is kept secret.
All communications involve only public keys, and no private key is ever transmitted.
Anyone can send a confidential message by just using public information, but the message can only be decrypted with a private key. The private key to unlock the data is the sole possession of the recipient. The private key is linked to the public key mathematically. In the RSA cryptosystem, the private and public keys are linked by the factorization of prime numbers. Alice looks up Bob's public key in a directory, uses it to encrypt the message and sends it off.