1 Fundamentals
Public key cryptography, also known as asymmetric cryptography, is a system in which two mathematically linked keys are used for secure communication and related tasks. One key is made public, while the other remains private. The method reduces the need for pre-shared secrets and is a foundation of modern digital security.
1.1 Symmetric vs. asymmetric cryptography
Symmetric cryptography uses the same secret key for both encryption and decryption. It is typically fast and well suited to bulk data protection. Asymmetric cryptography uses a key pair instead of a single shared secret, which makes it easier to exchange information securely across open networks.
The two approaches are often complementary. In practice, public key methods are usually used to exchange or protect a short secret, while symmetric algorithms handle the larger data stream.
1.2 Key pairs
A key pair consists of two related keys created together. The mathematical relationship allows one key to perform an operation that can only be reversed by the other. This pairing is central to encryption, signatures, and key exchange.
1.2.1 Public key
The public key is designed to be shared widely. Others can use it to encrypt messages to the owner, verify digital signatures, or participate in a key agreement. Its openness is what makes asymmetric cryptography practical on large networks.
1.2.2 Private key
The private key must remain confidential. It is used to decrypt messages intended for the owner or to create digital signatures. If it is exposed, the security of the associated system may be compromised.
1.3 Core security goals
Public key cryptography supports several basic security goals. These goals are not always achieved by the same operation, but together they explain why the technique is so widely used.
1.3.1 Confidentiality
Confidentiality means that information is accessible only to authorized parties. Public key encryption can protect a message so that only the holder of the corresponding private key can read it.
1.3.2 Integrity
Integrity ensures that data has not been altered in transit or storage. Digital signatures are commonly used to detect tampering by binding a message to the signer’s private key.
1.3.3 Authentication
Authentication confirms identity or origin. A verified signature, certificate, or key exchange can provide evidence that a message or connection comes from the expected party.
1.3.4 Non-repudiation
Non-repudiation refers to the inability of a sender to credibly deny having signed a message, assuming the private key was properly controlled. This property is especially important in legal, financial, and administrative settings.
2 Mathematical foundations
Public key systems depend on number theory and related branches of mathematics. Their strength comes from the fact that certain operations are easy to perform in one direction but hard to reverse without special information.
2.1 Number theory
Number theory studies the properties of integers and their relationships. Many cryptographic schemes are built from arithmetic involving primes, remainders, and modular calculations.
2.1.1 Prime numbers
Prime numbers are integers greater than 1 that have no positive divisors other than 1 and themselves. They play a central role in cryptography because they support structures with useful algebraic properties.
2.1.2 Modular arithmetic
Modular arithmetic works with remainders after division by a fixed number. It is the language of many public key algorithms, where calculations are performed within a finite set of values.
2.2 Hard mathematical problems
The security of public key systems depends on problems believed to be computationally difficult. These problems can be used to create trapdoors that are easy to apply with a secret but hard to undo without it.
2.2.1 Integer factorization
Integer factorization is the task of decomposing a large composite number into its prime factors. For sufficiently large values, this is difficult with known classical methods and underlies RSA security.
2.2.2 Discrete logarithms
The discrete logarithm problem asks for an exponent in a finite group when the base and result are known. It is difficult in many settings and supports systems such as Diffie–Hellman and ElGamal.
2.2.3 Elliptic curve problems
Elliptic curve cryptography uses groups formed from points on elliptic curves. The analogous discrete logarithm problem in this setting is believed to be difficult even with smaller key sizes than many older methods.
2.3 Trapdoor functions
A trapdoor function is easy to compute in one direction but hard to reverse unless special secret information is known. This concept is fundamental to public key cryptography because it allows public operations to be safe while private operations remain practical.
3 Key operations
Public key cryptography is commonly used for encryption, signatures, and key exchange. Each operation serves a different purpose and may involve a distinct algorithmic process.
3.1 Encryption and decryption
Encryption transforms readable data into an unreadable form, while decryption restores the original message. In public key systems, the public key often encrypts and the private key decrypts, though some schemes are designed around other roles.
3.1.1 Public-key encryption
Public-key encryption allows anyone with the public key to send a confidential message to the key holder. This is useful when the sender cannot establish a prior shared secret.
3.1.2 Hybrid encryption
Hybrid encryption combines public key methods with symmetric encryption. The public key protects a short session key, and the session key then encrypts the bulk data efficiently.
3.2 Digital signatures
Digital signatures provide a cryptographic method for proving message origin and preserving integrity. They are widely used in software distribution, secure messaging, and document workflows.
3.2.1 Signing process
In the signing process, a message is transformed into a compact signature using the signer’s private key. Often, a hash of the message is signed rather than the full message itself.
3.2.2 Verification process
Verification uses the public key to check whether the signature matches the message. If the data has been changed or the signature is invalid, verification fails.
3.3 Key exchange
Key exchange is the process of establishing a shared secret over an insecure channel. Public key techniques make this possible without exposing the secret to eavesdroppers.
3.3.1 Diffie–Hellman family
The Diffie–Hellman family of methods lets two parties derive a common key from exchanged public values. The protocol is central to many secure communication systems.
3.3.2 Key agreement protocols
Key agreement protocols combine public operations and local secret values to produce shared session keys. They are designed to resist interception and often include authentication features.
4 Major algorithms
A number of widely known algorithms implement public key cryptography. Some are historical standards, while others remain active in contemporary systems.
4.1 RSA
RSA is one of the best-known public key algorithms. Its security is based on the difficulty of factorizing a large composite number.
4.1.1 Key generation
RSA key generation begins with the selection of large prime numbers. These values are combined to form a modulus and related exponents that define the public and private keys.
4.1.2 Encryption and decryption
RSA encryption uses the public key to transform a message into ciphertext. Decryption applies the private key to recover the original data.
4.1.3 Signature scheme
RSA can also be used for digital signatures. In this role, the private key creates the signature and the public key verifies it.
4.2 Diffie–Hellman
Diffie–Hellman is a key agreement method rather than a full encryption system. It is designed to create a shared secret over an open network.
4.2.1 Finite-field DH
Finite-field Diffie–Hellman operates in a multiplicative group of integers modulo a prime. It is conceptually straightforward and historically important.
4.2.2 Ephemeral DH
Ephemeral Diffie–Hellman uses temporary session keys for each exchange. This improves forward secrecy because past session keys are less likely to be exposed if long-term keys are later compromised.
4.3 Elliptic Curve Cryptography
Elliptic Curve Cryptography, or ECC, is a family of public key methods based on elliptic curve mathematics. It offers strong security with relatively short keys.
4.3.1 ECC key generation
ECC key generation selects a private scalar and computes a corresponding public point on the curve. The relationship is easy to compute but difficult to reverse.
4.3.2 ECDSA
ECDSA is an elliptic curve digital signature algorithm. It provides signature generation and verification with compact keys and signatures compared with many older schemes.
4.3.3 ECDH
ECDH is an elliptic curve version of Diffie–Hellman key exchange. It is commonly used to establish shared secrets in secure protocols.
4.4 ElGamal
ElGamal is a public key system based on discrete logarithms. It can be used for encryption and signatures in various forms and influenced later cryptographic designs.
4.5 Paillier
Paillier is a public key cryptosystem known for additive homomorphic properties. This means certain computations can be performed on ciphertexts in a way that corresponds to operations on the underlying plaintexts.
4.6 Post-quantum candidates
Post-quantum candidates are cryptographic algorithms designed to resist attacks from quantum computers. They include methods based on lattices, codes, multivariate equations, and other hard mathematical structures.
5 Infrastructure and standards
Public key cryptography is most useful when supported by standards and trust frameworks. These systems define how keys are distributed, validated, and used across networks.
5.1 Public key infrastructure
Public key infrastructure is the collection of policies, hardware, software, and procedures used to manage public keys and certificates. It provides a framework for trust in open environments.
5.1.1 Certificates
Certificates are digital documents that bind a public key to an identity or name. They allow users and systems to trust that a key belongs to the stated entity.
5.1.2 Certificate authorities
Certificate authorities issue and sign certificates after performing validation steps. Their signatures help others rely on the binding between identities and public keys.
5.1.3 Certificate chains
Certificate chains link a leaf certificate to one or more intermediate authorities and ultimately to a trusted root. Verification follows this chain to establish trust.
5.2 X.509 standard
X.509 is a widely used standard for public key certificates. It defines certificate structure, fields, and validation-related conventions used across many secure systems.
5.3 OpenPGP
OpenPGP is a standard for encrypting and signing data, especially email and files. It supports user-managed keys and a decentralized trust model.
5.4 Transport Layer Security
Transport Layer Security is a protocol that secures communication over networks such as the internet. It relies on public key methods during setup and symmetric cryptography for the session itself.
5.4.1 Handshake
The handshake establishes protocol settings, authenticates parties when required, and negotiates shared session keys. Public key operations are a central part of this initial exchange.
5.4.2 Certificate validation
Certificate validation checks whether the certificate is trustworthy and appropriate for the connection. It examines expiration, signatures, and chain integrity.
6 Applications
Public key cryptography supports many everyday digital services. Its uses range from browser security to software distribution and financial systems.
6.1 Secure web browsing
Secure web browsing relies on public key cryptography to authenticate websites and set up encrypted connections. This helps protect login credentials, personal data, and transaction details.
6.2 Email encryption
Email encryption protects the contents of messages from unauthorized reading. Public key methods can also verify the sender’s identity through signatures.
6.3 Code signing
Code signing attaches a digital signature to software or scripts. Users and operating systems can then check whether the code came from a recognized source and was not altered.
6.4 Authentication systems
Authentication systems use public key techniques for login, device pairing, and identity verification. Keys may be stored in hardware tokens, secure enclaves, or authentication apps.
6.5 Digital currencies and blockchains
Digital currencies and blockchains often use public key signatures to authorize transfers and control ownership. Wallets typically depend on private keys for spending and public keys for address-related functions.
6.6 Secure software updates
Secure software updates use signatures to ensure that downloaded updates are genuine. This helps prevent tampering and malicious replacement during distribution.
7 Security considerations
The strength of public key cryptography depends not only on mathematics but also on correct implementation and careful operational practices. Poor handling can undermine even sound algorithms.
7.1 Key management
Key management covers the full lifecycle of cryptographic keys, from creation to retirement. It is often the most delicate part of deploying a secure system.
7.1.1 Key generation
Keys must be generated with enough randomness and appropriate size to resist attack. Weak generation can produce predictable keys and serious vulnerabilities.
7.1.2 Key storage
Private keys should be stored in protected environments such as hardware modules or encrypted containers. Access controls help reduce the chance of theft or misuse.
7.1.3 Key rotation
Key rotation replaces old keys with new ones at scheduled intervals or after suspected compromise. Regular renewal limits the impact of a damaged key.
7.2 Implementation pitfalls
Even strong algorithms can fail if implemented incorrectly. Common errors often involve randomness, side channels, or formatting rules.
7.2.1 Random number generation
Many cryptographic operations require high-quality randomness. Predictable random values can expose private keys or weaken signatures and encryption.
7.2.2 Side-channel attacks
Side-channel attacks exploit information such as timing, power use, or electromagnetic emissions. These attacks target the implementation rather than the underlying mathematics.
7.2.3 Padding errors
Padding errors occur when data is formatted incorrectly before encryption or signing. Such mistakes may lead to message corruption or enable practical attacks.
7.3 Trust and verification
Trust in public key systems depends on how keys and identities are verified. Users and software must decide whether to rely on certificates, fingerprints, policy checks, or direct verification.
7.4 Quantum computing threats
Quantum computers may one day solve certain public key problems more efficiently than classical machines. This possibility has driven research into post-quantum cryptography and migration planning.
8 Historical development
Public key cryptography emerged from theoretical work and later became essential to digital communication. Its development reshaped secure computing.
8.1 Early concepts
Before modern public key systems, cryptography was largely based on shared secrets. Research into one-way functions and trapdoor ideas helped prepare the ground for asymmetric methods.
8.2 Diffie–Hellman proposal
The Diffie–Hellman proposal introduced the idea of public key exchange in a practical and influential form. It showed that two parties could establish a shared secret over an open channel.
8.3 RSA invention
RSA provided the first widely adopted public key algorithm for encryption and signatures. It made the abstract theory of asymmetric cryptography more accessible and deployable.
8.4 Growth of internet cryptography
As networked computing expanded, public key methods became essential for secure email, web browsing, and online commerce. Standards and browser support helped bring cryptography into everyday use.
8.5 Modern adoption
Modern systems use public key cryptography across devices, cloud services, and embedded platforms. Continued adoption has been shaped by performance demands, certificate ecosystems, and security best practices.
9 Comparison with related techniques
Public key cryptography is one part of a broader cryptographic toolkit. It is often compared with symmetric methods, hash functions, and hybrid designs.
9.1 Symmetric cryptography
Symmetric cryptography is faster and simpler for large amounts of data, but it requires a shared secret in advance. Public key cryptography solves the key-sharing problem and often works alongside symmetric methods.
9.2 Hash functions
Hash functions produce fixed-length digests from arbitrary input and are not reversible. They are commonly used with public key schemes for message digests, integrity checks, and signature preparation.
9.3 Digital signatures vs. encryption
Digital signatures and encryption serve different purposes. Encryption hides content, while signatures prove origin and integrity; a single public key system may support one or both, depending on the algorithm.
9.4 Public key cryptography in hybrid systems
Hybrid systems combine public key and symmetric techniques to balance security and efficiency. This design is common because it uses asymmetric cryptography for trust establishment and symmetric cryptography for data throughput.