Fluxtail
Log Management Guides

What Is Public Key Cryptography How It Secures the Web

Learn what is public key cryptography, how key pairs enable encryption and signatures, and how RSA, ECC, TLS, and PKI keep modern systems secure.

2026-08-14 public key cryptography what is public key cryptography RSA and ECC PKI certificates TLS encryption

You've probably done this a hundred times without thinking about it. You open a bank site in a browser, or SSH into a server you've never touched before, and trust appears to happen instantly. No one handed you a shared password in advance, yet the connection still has to prove it's talking to the right party.

That problem is the reason public key cryptography matters. Before it, secure systems depended on shared secrets that had to be exchanged out of band, which doesn't scale well when the other side is a browser, a remote server, or an API you've never met. Public key cryptography emerged in the mid-1970s as a major answer to that key-distribution problem, starting with the public description of key agreement in 1976 and the practical RSA system shortly after, which turned secure communication into something deployable at internet scale. The field moved fast from theory to production-ready architecture, and that speed still shapes how we build trust today. The historical milestone record makes that timeline hard to miss.

For SREs and platform engineers, the important part isn't just the math. It's the operational reality that every private key becomes a production dependency, every certificate has a lifecycle, and every trust failure shows up as an incident at the worst possible time. That's why this topic is worth learning as a systems problem, not just a cryptography lesson. NIST's glossary puts the core idea plainly, parties can communicate securely without a prior shared secret by using a public and private key pair, and the public key can be distributed widely because the private key is computationally infeasible to derive from it. NIST's definition is the cleanest place to start.

Table of Contents

Introduction to a World Without Shared Secrets

A secure connection feels boring when it works. Your browser loads a site, the padlock appears, SSH accepts your session, and nobody asks you to email a password first. That boring experience hides a hard systems problem, how do two machines trust each other when they've never shared a secret before?

That's the gap public key cryptography fills. NIST describes it as a way for parties to communicate securely without prior access to a shared secret, using a public/private key pair where the public key can be shared freely and the private key can't be recovered from it in practice. NIST's glossary entry matters because it cuts through the folklore, the security boundary is the private key, not secrecy of the algorithm.

For platform teams, that distinction has real consequences. You don't just “set up encryption” and move on. You manage private key storage, certificate issuance, trust chains, rotation, revocation, and the nasty edge cases when a host can't validate a peer and the whole handshake falls apart. That's the SRE lens, trust is a living system with failure modes.

Practical rule: if you can't answer where the private key lives, who can read it, and how it gets rotated, you don't actually have a secure deployment yet.

The history helps explain why this architecture won. Public key cryptography became the backbone of modern internet security quickly after its introduction. The National Cybersecurity Center of Excellence notes that the 1976 breakthrough enabled parties to establish keys without a protected channel and made digital signatures possible, which is why it became a core building block of PKI and secure online transactions. NCCoE's timeline overview shows how quickly the field expanded into multiple algorithm families.

That's the journey here. Start with the mental model, then move to the mechanics, then land on the operational work you own in production.

How Public and Private Keys Work Together

Think of a public key like a mailbox slot and the private key like the only key that opens the box. Anyone can drop mail in, but only the owner can retrieve it. The important part is that the mailbox isn't secure because the slot is hidden, it's secure because only one side has the thing that opens it.

Public key cryptography uses that same one-way relationship. A key pair is generated together, one key is made public, the other stays private, and the math is designed so that knowing the public key doesn't let an attacker derive the private key in any practical sense. NIST's wording is careful here, it says that deriving the private key from the public key is computationally infeasible, which is very different from impossible in the absolute sense. That distinction is why operational controls still matter.

A diagram explaining that encryption, signing, and key exchange are distinct functions of public key cryptography.

The trust anchor is simple, but unforgiving. If the private key leaks, the system is compromised. If the public key is wrong, the wrong party gets trusted. If the key pair is rotated carelessly, services break even when the cryptography itself is fine.

The security boundary is private key secrecy. Everything else, certificates, algorithms, protocols, and tooling, exists to protect or distribute trust around that one fact.

A lot of confusion comes from treating the algorithm as the secret. That's not how this works. Public key systems assume the algorithm is known, published, and inspected. Security comes from the private key staying private and the math being hard enough that attackers can't reverse it in practice.

If you want the shortest possible definition, keep it simple. Public key means “share this widely.” Private key means “lock this down hard.” The pair gives you a clean way to separate distribution from secrecy, which is the core design advantage that made secure internet protocols possible.

Encryption Signing and Key Exchange Are Different Jobs

A lot of explanations flatten public key cryptography into a single sentence, “public key encrypts, private key decrypts.” That's only one job. In real protocols, public key cryptography also handles digital signatures, key exchange, and key encapsulation, and each one solves a different problem with different trust properties.

Three directions, three outcomes

For encryption, anyone with the public key can lock data, and only the private-key holder can decrypt it. That's about confidentiality. For signatures, the owner uses the private key to sign, and anyone with the public key can verify. That's about authenticity and integrity. For key exchange, both sides use public-key math to agree on a shared secret without shipping that secret directly over the network.

The important operational point is that most production systems don't use public key cryptography to encrypt large payloads. They use it to establish trust, then switch to symmetric encryption for the actual data channel. That's why TLS and SSH feel fast after the handshake, the expensive asymmetric work happens first, then the session moves to a shared symmetric key.

Operational shortcut: when you're reading a protocol trace, ask whether the public key is being used for confidentiality, authenticity, or session setup. If you know the job, you can usually predict the failure mode.

That distinction also explains why public key cryptography shows up everywhere in identity work. NIST's definition covers the key-distribution problem, but the broader ecosystem leans heavily on signatures for software updates, certificates, and service identity. The volume use is often authentication, not just message secrecy, which is why so many outages appear as verification failures rather than plain decryption errors.

The historical arc shows how quickly the field diversified once the first key-agreement idea landed. The milestone record traces public key cryptography from the 1976 disclosure to RSA in 1977 and 1978, then ElGamal in 1984 and elliptic curve cryptography by 1985. The invention timeline is a reminder that this wasn't a single algorithm, it became an entire family of tools.

Public key cryptography is best understood as a toolbox, not a feature. Once you stop asking “does it encrypt?” and start asking “what job is it doing here?”, the whole stack gets easier to reason about.

Major Algorithms Behind Public Key Cryptography

The names matter less than the trade-offs. Each major algorithm family came from the same basic need, but each one favored a different balance of math, key size, and operational fit. That's why you still see multiple families coexist instead of one universal winner.

RSA and Diffie-Hellman started the modern pattern

Diffie-Hellman key agreement showed up first in public form in 1976. Its big contribution was letting two parties agree on a shared secret over an untrusted channel, which is why it's foundational to key exchange. RSA, created in 1977 and published in 1978, brought practical public-key encryption and digital signatures into reach, based on the difficulty of factoring large integers. Those two ideas seeded most of the public-key systems engineers still touch today. The ETHW milestone page captures that sequence cleanly.

ElGamal and elliptic curves expanded the design space

ElGamal followed in 1984, which showed that public-key cryptography wasn't a one-off trick but a broader mathematical field. By 1985, elliptic curve cryptography had entered the picture, and that matters operationally because it gave teams another option when performance and key size started to matter more. The point isn't that one family replaced the others, it's that the ecosystem widened quickly once the core idea proved itself.

In production, teams often care about resource footprint more than theory. Smaller keys can reduce overhead, especially on constrained devices or high-volume services, while older families may be easier to support across legacy stacks. RSA's longevity is part of its appeal, but ECC is widely discussed when efficiency matters more than compatibility.

Here's the simplest engineering lens.

Family Main strength Typical concern
RSA Broad familiarity and long history Larger keys and heavier operations
Diffie-Hellman Key agreement over public networks Needs careful parameter and implementation choices
ElGamal Flexible public-key design Less common in everyday platform work
ECC Efficiency and smaller keys Dependency on consistent library and protocol support

The reason these algorithms coexist is practical, not ideological. Different protocols, libraries, and hardware targets make different trade-offs, and standards don't change as fast as the underlying math. That's why platform teams still end up supporting more than one family during migrations, especially when older services and newer clients have to interoperate.

How TLS and SSH Use Public Keys in Practice

A browser connection to a server and an SSH login both rely on public keys, but they solve different trust problems. TLS usually asks, “Can this server prove it owns the identity in its certificate?” SSH often asks, “Do I already trust this host key, and is this user allowed in?” In production, the useful question is not whether public-key cryptography exists, but which part of the handshake, trust store, or key lifecycle is failing.

A diagram illustrating the step-by-step process of how TLS and SSH protocols utilize public keys for secure communication.

TLS as a trust-and-switch handshake

In TLS, the server presents a certificate that binds its identity to a public key. The client checks the certificate chain, confirms the hostname, and then uses that trusted identity to negotiate a symmetric session key. After that point, bulk traffic moves over symmetric encryption, which is why TLS setup problems usually show up before the session is established, not after.

Operators tend to meet the rough edges here first. A certificate can be expired, the chain can be incomplete, the hostname can fail to match, or an intermediate device can interfere with negotiation. The error often looks like a generic handshake failure, but the cause is usually certificate validation, trust chain building, or client verification behavior.

If you are tracing that path, Fluxtail's SSL handshake troubleshooting notes help keep the diagnosis on the actual break point, certificate validity, trust chain, protocol version, or client-side checks. For related deployment detail, understanding SMTP TLS ports is useful because mail clients hit many of the same certificate and trust-chain checks that web clients do.

SSH as host trust plus user identity

SSH uses public keys in a different order. First, the client checks the server's host key, which tells it whether this is the same host it saw before. Then the server can verify a user key, which lets a person authenticate without a password when the environment is configured that way. Those are separate trust decisions, so a failure can come from host verification or from user authentication, and the logs usually point to different layers.

A practical triage pattern helps.

  • Check host-key changes first: If the remote host key changes without an expected rotation, treat it as a trust event, not a routine login failure.
  • Check user-key permissions second: If authentication fails, the cause is often the key file, agent forwarding, or the allowed identity mapping on the server.
  • Check session encryption last: Once trust is established, the encrypted session itself is rarely the problem.

The SRE lesson is simple. TLS and SSH both use public keys, but they use them to answer different questions about identity, trust, and access. If you can tell which step failed, you can shorten an incident without guessing at the cryptography.

Where PKI Breaks: Certificate Lifecycle and Outage Prevention

A single key pair is not enough for internet-scale trust. You need a system that says, “this public key belongs to this identity, and we can verify that claim consistently.” That system is PKI, public key infrastructure, and certificates are the bridge between raw keys and operational trust.

Certificates make identity machine-readable

A certificate binds a subject to a public key, and a certificate authority vouches for that binding by signing it. The client or server then walks the validation chain to decide whether the certificate should be trusted. That chain is what lets a browser trust a site it's never seen before, or a service trust a peer across a large, untrusted network.

The historical importance of this is easy to miss because PKI now feels routine. Public-key cryptography became a core building block of later PKI systems and secure online transactions because it made digital signatures possible and removed the need for a protected channel during key establishment. The broader evolution of internet security is laid out in NCCoE's cryptographic standards overview.

Lifecycle is where outages happen

PKI is a lifecycle, not a one-time setup. Keys get issued, certificates get renewed, trust chains get rotated, and compromised or obsolete material has to be revoked. Expiry monitoring matters because a forgotten certificate can take a service down just as hard as a broken deployment.

Revocation is the part many teams underestimate. A certificate can be technically valid on paper and still unsafe in practice if the key behind it was compromised. That is why validation systems use revocation mechanisms such as CRL and OCSP, even when the day-to-day path mostly feels automatic.

SRE rule of thumb: if certificates are only visible during outages, the system is under-instrumented.

The operational takeaway is that PKI behaves like any other control plane. It needs ownership, auditability, renewal automation, and a rollback story. If you treat it as a static config file, you'll eventually find out how sharp the edge cases are. For a related deployment detail, understanding SMTP TLS ports is useful because mail clients hit many of the same certificate and trust-chain checks that web clients do.

Operating Public Key Cryptography Securely

Secure crypto fails like any other production dependency, through weak storage, bad automation, stale inventory, or missed rotation. The math can be sound and the service can still fall over because the private key sat in the wrong place or a certificate expired unnoticed.

Keep the private key where attackers can't reach it

The private key should live in the narrowest possible trust boundary. That means strict access control, hardware-backed storage where appropriate, and a clear answer to who can read, export, or sign with the key. Hardware security modules help because they reduce exposure, but they don't replace governance, logging, or review.

Rotation should be routine, not a panic move. Automate renewal where you can, especially for certificates tied to service traffic or internal APIs, and keep a process for revocation when a key is suspected compromised. If you're checking the surrounding TLS stack, a focused NGINX configuration review often catches certificate and protocol mistakes before they turn into outages.

Be honest about the limits

Public key cryptography is not about unconditional security. The IACR material on the misconception is clear, these systems depend on computational hardness, not absolute protection, and quantum computing adds pressure to classic assumptions. The IACR paper is a good reminder that long-term cryptographic planning has to account for post-quantum migration, not pretend today's schemes are forever.

A practical hardening checklist looks like this:

  • Inventory every private key: Know where it is, which service depends on it, and who can access it.
  • Automate renewal and alerts: Don't rely on manual calendar reminders for cert expiry.
  • Log trust failures centrally: Handshake errors, verification failures, and revocation issues should all be searchable.
  • Review algorithm choices regularly: Legacy compatibility isn't a reason to ignore newer guidance.
  • Plan for key compromise: Have a documented revocation and replacement path.

If you want the short version, it's this. Public key cryptography gives you scalable trust, but operations determine whether that trust survives contact with production. The teams that treat keys, certs, and validation as first-class infrastructure stay ahead of the incidents that catch everyone else by surprise.


If you want tighter visibility into certificate failures, key rotation events, and trust-chain breaks during incidents, visit Fluxtail and see how centralized, readable logs help engineering teams investigate production cryptography problems faster. Fluxtail keeps security-relevant events in one place, so you can spot handshake regressions, expiry warnings, and authentication failures without stitching together five tools.