What is Public-key cryptography?
A cryptographic method that uses a matched pair of different keys for encryption and decryption: a public key and a private key. The public key may be known to anyone, while only its owner holds the private key. It makes key distribution easy but is computationally heavy, so it is combined with symmetric-key cryptography for encrypting the data itself. RSA and elliptic-curve cryptography are typical examples.
Japanese name: 公開鍵暗号
Public-key cryptography appears in 5 practice questions across 2 topics, including Information Security Basics, Hardware Security.
Field: Information Security Basics
Differences from symmetric-key cryptography and the number of keys
With symmetric-key cryptography, every pair of people who communicate must share a secret key in advance, so n people need n(n−1)/2 keys. With public-key cryptography each person needs only one key pair, for 2n keys in total. For 100 people, for example, symmetric-key cryptography needs 4950 keys and public-key cryptography 200. On the other hand, public-key computations are orders of magnitude heavier than symmetric-key ones, so in practice hybrid encryption is common: the data itself is encrypted with symmetric-key cryptography, and public-key techniques are used to hand over or agree on that key.
Confirming who owns a public key
In public-key cryptography it matters whether the public key in use really belongs to the other party. If an attacker passes off their own public key as someone else's, ciphertext meant for that person can be read by the attacker. Certificates, in which a certificate authority (CA) signs a statement that "this public key belongs to this person (domain name)," are therefore used to guarantee who owns a public key. This mechanism is called PKI (public key infrastructure), and the TLS server certificates used in HTTPS are a typical example. As of the mid-2020s, migration to post-quantum cryptography, in preparation for future quantum computers, is also under way.
FAQ
Whose key is used when encrypting with public-key cryptography?
The recipient's public key. Only the matching private key held by the recipient can decrypt it. Processing with your own private key is what a digital signature does, not encryption.
Why not encrypt large files with public-key cryptography alone?
Because public-key cryptography is computationally heavy and not suited to encrypting large data directly. Hybrid encryption is used instead: the file is encrypted with fast symmetric-key cryptography, and only that symmetric key is protected with public-key cryptography.