Public and private keys
Public and private keys are used in encryption to securely send data over a network. They work as a pair to ensure that only the intended recipient can read the data.
How they work
- Each user has a key pair:
- A public key (shared with others)
- A private key (kept secret)
- When sending data:
- The sender uses the recipient’s public key to encrypt the data
- The encrypted data is sent over the network
Public key
- Shared openly with others
- Used to encrypt data
Private key
- Kept secret by the owner
- Used to decrypt data