Public Key Cryptography
A key is a piece of information, usually a string of numbers or letters
If you use a single key, its symmetric cryptography
Public-key, or asymmetric cryptography, is a system that uses pairs of keys based on mathematical one-way functions
There are two keys, one public, one private, they are a pair
Only the private key can decrypt a message which is encrypted with its public key
And public key can verify if a message is signed with its private key
eg.
- Alice and Bob shares their public keys in the open,
Bob
- writes a message to Alice
- signs it with his private key
- encrypts it using Aliceβs public key and
Alice
- Gets the encrypted message
- Opens it using her private key
- Verifies the signature using Bobβs public key
https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange