The key type used in public key cryptography is an asymmetric key pair , consisting of a public key and a private key, which are mathematically related but different.

Core idea in one line

Public key cryptography (also called asymmetric cryptography) uses two different keys :

  • a public key that can be shared with anyone
  • a private key that must be kept secret.

Mini breakdown

  • In symmetric cryptography, the same key is used to encrypt and decrypt data.
  • In public key cryptography, asymmetric keys are used: one key encrypts (often the public key), and the other decrypts (the private key).
  • The security comes from hard one‑way mathematical problems (for example in RSA or elliptic‑curve systems) that make it easy to compute the key pair but infeasible to derive the private key from the public key.

Quick examples

Common asymmetric/public key algorithms include:

  • RSA (Rivest–Shamir–Adleman)
  • Elliptic‑curve cryptography (ECC), such as Curve25519 and NIST P‑256
  • Diffie–Hellman and elliptic‑curve Diffie–Hellman for key exchange.

TL;DR: When asking “which key type is used in public key cryptography?”, the answer is: asymmetric key pairs (public key + private key) , not a single shared symmetric key.

Information gathered from public forums or data available on the internet and portrayed here.