If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains ***.kastatic.org** and ***.kasandbox.org** are unblocked.

Main content

Current time:0:00Total duration:3:56

up until the 1970s cryptography had been based on symmetric keys that is the sender encrypts their message using a specific key and the receiver decrypts using an identical key as you may recall encryption is a mapping from some message using a specific key to a cipher text message to decrypt the cipher text you use the same key to reverse the mapping so for Alice and Bob to communicate securely they must first share identical keys however establishing a shared key is often impossible if Alice and Bob can't physically meet or requires extra communications overhead when using the diffie-hellman key exchange plus if Alice needs to communicate with multiple people perhaps she's a bank then she's going to have to exchange distinct keys with each person now she'll have to manage all of these keys and send thousands of messages just to establish them could there be a simpler way in 1970 James Ellis a British engineer and mathematician was working on an idea for non-secret encryption it's based on a simple yet clever concept lock and unlock are inverse operations Alice could buy a lock keep the key and send the open lock to Bob Bob then locks his message and send it back to Alice no keys are exchanged this means she could publish the lock widely and let anyone in the world use it to send her a message and she now only needs to keep track of a single key Alice never arrived at a mathematical solution though he had an intuitive sense of how it should work the idea is based on splitting a key into two parts an encryption key and a decryption key the decryption key performs the inverse or undo operation which was applied by the encryption key to see how inverse keys could work let's do a simplified example with colors how could Bob send Alice a specific color without Eve who is always listening intercepting it the inverse of some color is called a complementary color which when added to it produces white undoing the effect of the first color in this example we assume that mixing colors is a one-way function because it's fast to mix colors and output a third and it's much slower to undo Alice first generates her private key by randomly selecting a color say red next assume Alice uses a secret color machine to find the exact complement of her red and nobody else has access to this this results in cyan which she sends to Bob as her public key let's say Bob wants to send a secret yellow to Alice he mixes this with her public color and sends the resulting mixture back to Alice now Alice adds her private color to Bob's mixture this undoes the effect of her public color leaving her with Bob's secret color notice Eve has no easy way to find Bob's yellow since she needs Alice's private red to do so this is how it should work however a mathematical solution was needed to make this work in practice