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

Using the public and private keys

In public-key cryptography each person has a mathematically matched public key and private key. To keep something secret, the sender encrypts with the recipient's public key and only the recipient can decrypt with their own private key. To prove identity, the owner creates a signature with their own private key and anyone can verify it with the owner's public key (a digital signature). Security rests on the fact that deriving the private key from the public key is practically impossible: for RSA because factoring large numbers is hard, and for elliptic-curve cryptography because of the difficulty of the discrete logarithm problem on elliptic curves.

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.

Try it: questions about Public-key cryptography

Using public-key cryptography, A wants to encrypt a message so that only B can read it. Which key is used for the encryption?

  1. AA's private key
  2. BB's public key
  3. CB's private key
Show answer and explanation

Answer: B. B's public key

In public-key cryptography each person has a pair of keys: a public key and a private key. The public key may be known to anyone, while only its owner keeps the private key, closely guarded. Data encrypted with a public key can be decrypted only with the matching private key. So A encrypts with B's public key and sends the message, and B decrypts it with B's own private key. Even if the ciphertext is intercepted on the way, anyone without B's private key cannot read it. Only B holds B's private key, so A cannot use it. Processing with A's private key is what happens in a digital signature, which shows that A created the data.

Fifty members want every pair of them to be able to communicate with encryption without the other members learning the contents. Which combination gives the number of keys needed with symmetric-key cryptography and with public-key cryptography (counting public and private keys together)?

  1. ASymmetric-key: 1225 keys; public-key: 100 keys
  2. BSymmetric-key: 2450 keys; public-key: 100 keys
  3. CSymmetric-key: 100 keys; public-key: 1225 keys
Show answer and explanation

Answer: A. Symmetric-key: 1225 keys; public-key: 100 keys

With symmetric-key cryptography each pair needs its own key, because if three or more people shared a key, other members could read the contents too. The number of pairs that can be chosen from n people is n(n−1)/2, so 50 people need 50 × 49 / 2 = 1225 keys. With public-key cryptography, if each person has one public key and one private key, anyone can encrypt to anyone else with the recipient's public key, so 2n = 2 × 50 = 100 keys are enough. As the number of people grows, the number of symmetric keys grows roughly with the square of the number of people, whereas public-key cryptography grows only in proportion to it. This is one reason public-key cryptography makes key management easier.

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.

Public-key cryptography in the explanations

Questions that mention Public-key cryptography (5)

  1. Using public-key cryptography, A wants to encrypt a message so that only B can read it. Which key is used for the encryption?
  2. Fifty members want every pair of them to be able to communicate with encryption without the other members learning the contents. Which combination gives the number of keys needed with symmetric-key cryptography and with public-key cryptography (counting public and private keys together)?
  3. What is the advantage of using public-key cryptography to verify software signatures in secure boot?
  4. Which statement correctly describes symmetric-key cryptography?
  5. When sending a large file encrypted to someone, which procedure describes the commonly used hybrid encryption scheme?

Books on Information Security Basics Ad

As an Amazon Associate I earn from qualifying purchases.

Related terms

Symmetric-key cryptography Digital signature Secure boot TLS Cross-site scripting (XSS) Hash function Message authentication code Multi-factor authentication Phishing Principle of least privilege

Back to the glossary