Public-key cryptography, also called asymmetric cryptography, is a family of methods that use mathematically linked public and private keys with different roles. The public key can be shared openly, while the private key must remain protected. Depending on the scheme, these methods support confidential encryption, digital signatures or establishing shared secrets; not every algorithm or key pair supports all three.
How the Key Pair Works
The mathematical relationship in public-key cryptography allows public information to be useful without exposing the private key. Under the scheme's security assumptions, recovering the private key from the public key is computationally infeasible, meaning it would require impractical computing resources. That protection depends on appropriate parameters, secure key generation and a sound implementation. Two keys alone do not guarantee stronger security than a system based on a shared secret.
Encryption and Digital Signatures
For confidentiality, public-key cryptography allows a sender to encrypt a message with the intended recipient's public key. The recipient decrypts it with the corresponding private key. A secure encryption scheme, used correctly, protects the message's confidentiality. Encryption alone does not necessarily authenticate the sender or detect message tampering; those protections depend on the construction and protocol.
For a digital signature, the signer uses a private key to produce a signature on a message, and a verifier checks it with the matching public key. Successful verification supports integrity by checking that the signed message has not changed, and attributes the signature to that key. It does not hide the message or independently prove the signer's identity, because that requires a trustworthy association between the key and the person or organization. Signing is not simply “encrypting with a private key”: signatures and encryption are distinct operations with different security goals.
Looking for liquidity, exploring on-ramp/off-ramp services, or seeking expert guidance?
Get startedKey Establishment and Hybrid Encryption
Public-key techniques can let parties establish a shared secret without having a previously shared secret. In a key-agreement protocol, each party uses private information and exchanged public values to derive matching secret material. Observing the public exchange should not reveal that secret under the protocol's security assumptions, but an unauthenticated exchange remains vulnerable to an intermediary substituting keys.
Hybrid systems use public-key cryptography for key establishment and, where needed, authentication, then symmetric encryption for bulk data. Symmetric encryption uses the same secret key for encryption and decryption and is generally more efficient for large amounts of data. The symmetric key can be derived during connection setup; it need not be delivered beforehand through a separate secure channel.
Key Authenticity and Security Limits
The public key must be authenticated as belonging to the intended party. Otherwise, an attacker can substitute their own key, intercept an encrypted exchange or impersonate the expected signer. Public-key cryptography does not solve this identity problem merely by making keys public.
Certificates and public key infrastructure (PKI) are one way to bind keys to identities using trusted issuers. Other systems may rely on previously trusted keys or independently checked key fingerprints. Whatever the trust method, private keys need protection against copying, unauthorized use and loss. A stolen signing key can enable unauthorized signatures, while a compromised decryption key can expose data encrypted for it. Key replacement and decisions about whether a key is still trusted are therefore part of operating the system, not protections supplied by the mathematics alone.