What is public-key cryptography?

Public-key cryptography underpins much of today's digital security. Visiting a website over HTTPS, signing a document electronically, exchanging protected information, and using some blockchain systems all rely on it to verify identities and protect communications, without the parties having to share a secret key beforehand. It works with a pair of mathematically related keys, one public and one private, which do different jobs in the same system.

The shared-key problem

The approach grew out of a classic problem in cryptography. In symmetric-key systems, the sender and the recipient use the same secret key to encrypt and decrypt information. This can be very efficient and is still fundamental to computer security, but it is hard to use when the two parties have no secure channel to exchange that first key. Public-key cryptography changed this by letting one party publish a key without revealing the secret needed to decrypt certain information or produce a signature.

The system relies on mathematical properties that make it possible to generate two linked keys. The public key can be shared openly, while the private key must stay under the sole control of its owner. Both belong to the same cryptographic system, but knowing the public key should not, in practice, allow anyone to rebuild the private key. This asymmetry is what makes it possible to design secure communication over open networks such as the internet.

Private key Secret, never shared derived one way only Public key Can be shared derived one way only Address Used to receive funds Digital signature Created with the private key Anyone can verify it with the public key
Keys are derived one way only. The public key comes from the private key and the address from the public key, never the other way round.

Encryption

For encryption, the basic idea is simple. You can use a recipient's public key to protect a message meant for them, and they recover it with the matching private key. In many modern schemes the real process is more involved, and the asymmetric algorithm does not necessarily encrypt the whole content directly. Public-key cryptography is usually combined with symmetric algorithms, which are much more efficient for large amounts of data. The asymmetric technique sets up or protects a session key, and symmetric cryptography encrypts the communication itself.

This combination is essential in protocols such as TLS, the technology behind HTTPS connections. When a browser opens a secure connection with a server, it does not use asymmetric cryptography for the whole session. Public-key mechanisms are used during the initial handshake to authenticate the server and set up the cryptographic material that symmetric algorithms then use to protect the communication. This balances security, authentication, and computing efficiency.

Digital signatures

Public-key cryptography is also what makes digital signatures possible. Here the aim is usually to prove that a message is authentic and has not been changed, and hiding its contents may not matter. A digital signature is created with the signer's private key, and anyone can check it with the matching public key. If the check succeeds, there is cryptographic evidence that the signature comes from that key and that the signed content has not been altered since. This is why digital signatures matter for electronic transactions, digital certificates, signed software, and many identification systems.

A public key on its own does not prove who owns it. If you receive a key with no other way to check where it came from, an attacker could hand you a different key while pretending to be someone else. Public key infrastructure, usually called PKI, was developed to solve this. It uses digital certificates and certificate authorities to link an identity to a specific public key through trust structures that can be verified.

Digital certificates are most visible when browsing the web. When a browser connects to a domain protected by HTTPS, it can check the certificate the server presents and confirm that it was issued within a chain of trust the system recognizes. This does not remove every risk on the internet, but it gives a standard way to link digital identities to cryptographic material. Security depends on several factors, including keeping private keys protected and on the authorities and devices in the trust chain working correctly.

Algorithms

Over the past few decades, many algorithms based on different mathematical problems have been developed. RSA was for a long time one of the best-known and most widely used, especially for signing and encryption. Later, elliptic curve cryptography became very important because it reaches high security levels with smaller keys. Modern designs include algorithms for key exchange, such as X25519, and algorithms built for digital signatures, such as Ed25519. Each family serves specific purposes and has to be judged within the protocol that uses it, since security depends on more than the algorithm alone.

Public-key cryptography in cryptocurrencies

In cryptocurrencies and blockchain networks, public-key cryptography has an extra role. Addresses and accounts are generally linked to pairs of cryptographic keys, and transactions are authorized with digital signatures. In practice, the private key is the ability to produce valid signatures for specific funds or assets. Protecting it is one of the most critical parts of any digital asset system. Losing it can cut off access to the resources linked to it, and a leak can let someone else create authorizations that the system will accept as legitimate.

Limits and quantum computing

Public-key cryptography does not solve every threat. The algorithms can be sound and a system can still be vulnerable because of poor implementation, weak key management, configuration errors, or attacks on the devices that store the secrets. Security also depends on generating random numbers properly, renewing certificates, preventing leaks, and using well-designed protocols.

Quantum computing has created a new challenge for some current techniques. Quantum algorithms such as Shor's algorithm could break some of the mathematical problems used by RSA and certain elliptic curve schemes, if they were ever run on quantum machines powerful and fault-tolerant enough. This has driven the development of post-quantum cryptography, which aims to build public-key mechanisms that resist this kind of threat. The transition is complex because it affects digital infrastructure used worldwide and has to be planned years in advance.

Why open networks depend on it

Public-key cryptography makes it possible to build trust over networks that are insecure by nature. The internet allowed information to be exchanged on an unprecedented scale, but it needed ways to authenticate participants, protect communications, and prove that messages were intact. Asymmetric cryptography gave a mathematical basis for solving much of this and has become an essential, mostly invisible part of digital life.

It also shows how digital trust works in computer security. It takes more than keeping a password secret: it needs mathematical and operational systems that can show who is allowed to authorize an action, protect a communication, and detect unauthorized changes. The public key can be shared, but the private key has to stay under the owner's control. Much of the security that protects communications, digital services, electronic identities, and many financial and technological systems today is built on that distinction.