Public-Key Cryptography: The Key You Can Give Away
Handing out a security key sounds like a mistake. Public-key cryptography makes it useful: one key can be shared while its mathematically related partner stays private. Possessing the public part doesn't give someone the private part's powers.
A key is data used by a mathematical security method, or algorithm. Public-key cryptography, also called asymmetric cryptography, uses a public key and a private key with different roles. It is a family of methods, rather than one encryption technique.
The definition from the National Institute of Standards and Technology, or NIST, includes both encryption and digital signatures. The distinction matters because protecting a message from readers and proving that it hasn't changed are different tasks.
A message for one recipient
In a public-key encryption scheme, a sender uses the recipient's public key to protect a message. The matching private key is needed to decrypt it: turn the protected data back into readable information.
Suppose a researcher wants to send a confidential document to a colleague. The researcher can use the colleague's public key without learning the colleague's private key. The secret doesn't have to travel back to the sender before the exchange can begin.
How Do You Send a Secret Without Sharing a Secret First?
“Public” means the key doesn't need to be secret. It doesn't mean its holder must publish it everywhere. The private key, by contrast, must remain protected from unauthorized use.
A signature anyone can check
For a digital signature, the roles change. A signer uses a private key to create a signature associated with a message. Other people use the public key to verify it.
Suppose the researcher instead wants to publish a document and let readers check that it is the signed version. A valid check gives evidence that the data matches the signature and that the signature was produced using the matching private key.
The document can remain completely readable. A digital signature doesn't hide its contents, and signing isn't generally “encrypting with the private key.” Signature algorithms have their own methods and rules.
NIST's Digital Signature Standard describes detecting unauthorized changes and authenticating the signer as purposes of signatures. Naming that signer still requires a trustworthy connection between the public key and the person or organization.
- Make a stolen password useless without the key in your hand.
- Plug into a USB-C laptop or tap it against your phone.
- Use one key across Google, Microsoft, Apple and many more accounts.
Agreeing on a secret for a conversation
Public-key methods can also help two computers establish shared secret information. A key agreement method such as Diffie–Hellman lets them exchange public information and calculate a secret for use in their communication.
Consider a connection using Transport Layer Security 1.3, or TLS 1.3, with a digital certificate that links the server's name to its public key.
Public-key methods help establish secrets and authenticate the connection. The ongoing traffic is then protected with symmetric keys: secret key material used by both sides for the appropriate encryption and decryption operations. The TLS 1.3 specification separates those jobs.
Not every public-key algorithm performs every operation. An algorithm intended for signatures isn't automatically an encryption or key-agreement system.
Connecting a key to a name
A mathematically valid operation can't tell you, by itself, whose public key you received. If someone substitutes their own key for your colleague's, encrypting successfully can protect the document for the wrong recipient.
One way to make that connection is a digital certificate. The certificate-validation standard describes how software checks a chain of certificates against an authority it already trusts. That check gives software a basis for accepting the link between the name and the public key.
RSA: Two Keys With Different Jobs

Diffie–Hellman Key Exchange, With Numbers You Can Follow

Hybrid Encryption: Two Kinds of Keys, One Protected Message

QUOTE:
"Amateurs hack systems, professionals hack people."
