How public-key encryption works

Public-key cryptography uses a related key pair. A public key can be shared; a private key must remain secret. One common use is to encrypt data for a…

Public-key cryptography uses a related key pair. A public key can be shared; a private key must remain secret. One common use is to encrypt data for a recipient who can decrypt it with the private key, while signatures let others verify that a message came from the holder of the private key.

How it works

The mathematics does not protect a private key that is stolen or a public key that is substituted before it is trusted. Key management, verification and rotation are as important as the algorithm.

Practical takeaways

Use established protocols and libraries rather than inventing encryption. Protect private keys with strong access controls and keep recovery plans for encrypted data.

Encryption is a system of keys, identities and protocols; the algorithm alone is not the whole security model.

In short: Public-key cryptography uses a related key pair. A public key can be shared; a private key must remain secret. One common use is to encrypt data for a recipient who can decrypt it with the private key, while signatures let others verify that a message came from the holder of the private key.