What is an encryption key?
The verb encrypt means to convert plain text into code. So HELLO (the plain text) becomes KHOOR (the code) if you shift the alphabet three positions (the key). It's the key not the code that keeps the information secret.
So how does the sender securely share the key with the recipient, so they can decrypt the code?
Rather than sharing, one common method is for sender and recipient to jointly create a key from information they both have. This is known as the Diffe-Hellman key exchange protocol.
This can be illustrated using a paint analogy. Jen and Tim both have 500ml of red paint, and they tell everyone. Jen also has 500ml of orange paint, and Tim has 500ml of green paint, which they keep secret, including from each other.
Jen and Tim each mix 500ml of red paint with 250ml of their own secret colour to create two 750ml pots of different sludge-coloured paint, which they send to each other.
They each then add the remaining 250ml of their secret colour to the mixed paint, creating two new 1L pots of sludge-coloured paint. Each pot containing 500ml of red, 250ml of orange and 250ml of green. Both pots are the same colour - composed of the same constituent parts.
Substitute the paint for long strings of characters and you have a data encryption key. Tim and Jen both end up with the same string of characters, which they can use to encode and decode information they send to each other.
So at heart, encryption keys are simple. The example I used at the beginning, shifting the alphabet forward three places, is known as the 'Caesar Cypher', apparently used by Julius Caesar to send private messages.
The trouble is, over time keys get cracked - people work them out. Presumably quite quickly in Caesar's case.
So it doesn't pay to get complacent. Jumping to the near future, quantum computers are hugely powerful processors that can work out long keys by guessing again and again very fast. It surely won't be long before they make Diffe-Hellman look like the Caesar Cypher.