What Is a Public Key, and Why Is It Safe to Share?
A security key you can hand to a stranger sounds like a mistake. With a public key, sharing is part of the design. The secret that needs protecting is its partner: the private key.
A public key is a piece of data used in cryptography, the methods computers use to protect information and check its origin. It belongs to a mathematically related pair. The public half may be shared; the private half must be protected.
That pairing supports several different jobs. A public key might help encrypt information, verify a digital signature, or establish a shared secret. The algorithm determines what a key can do. An algorithm is the set of mathematical rules the system follows; not every algorithm supports every job.
NIST's public-key definition makes that distinction between encryption and signature verification. A public key isn't a password, and “public” doesn't mean it must appear on a public website. It means the system's security doesn't depend on keeping that half secret.
How Do You Send a Secret Without Sharing a Secret First?
Sending Something the Recipient Can Read
Encryption turns readable information into a form that requires the right key to recover. Recovering the readable version is called decryption.
For a public-key algorithm that supports encryption, the roles run in one direction: encrypt with the recipient's public key; decrypt with the matching private key.
Imagine a supplier sending a confidential design file to a manufacturer. In a system using this method, the supplier can obtain the manufacturer's public key and use it without receiving the manufacturer's private key. Sharing the secret key between the two companies isn't required for that public-key operation.
In practice, the file itself may use a symmetric key: a secret used for both encryption and decryption. The software can encrypt that secret key with the recipient's public key, then send it with the encrypted file. The recipient's private key recovers the symmetric key, which unlocks the file. NIST describes this combination in its guide to cryptographic mechanisms.
Anyone who has the manufacturer's public key could send encrypted material to it. Successfully opening the file doesn't, by itself, establish which supplier sent it.
A Signature Answers a Different Question
A digital signature is a mathematical check created from data and a signing private key. Someone with the corresponding public key can check whether the signature is valid for that data.
- Keep your private keys offline, where online thieves can't reach them.
- Manage thousands of coins and tokens from one device.
- Rely on a USB-C cable alone: there is no Bluetooth to attack.
Return to the design file. The supplier could sign it using its own signing private key. The manufacturer would check the signature using the supplier's public key. This is a separate operation from encrypting the file for the manufacturer.
Checking a signature can reveal that the signed data has changed. It also ties the signature to a particular key. NIST's Digital Signature Standard describes these integrity and authentication functions.
The signed file can remain readable to everyone. And the check can't tell the manufacturer whether the design itself is accurate. Linking the signature to the supplier depends on knowing whose public key it has and whether the private key stayed under its owner's control.
Calling a signature “encryption with the private key” obscures these differences. Signing and encryption are distinct cryptographic operations, with their own rules and purposes.
Two Keys: One You Share, One You Guard
How Do You Know Whose Key It Is?
Suppose someone replaces the manufacturer's published encryption key with a key they control. The supplier may encrypt the file correctly and still deliver a secret to the wrong party.
The supplier needs to check that the key belongs to the intended manufacturer. A digital certificate can help with that check. It binds a public key to a named subject, such as a system, using a signature from an issuer called a certification authority. The certificate is a separate item from the key itself.
The X.509 certificate standard describes this binding. It also allows certificates to be revoked before they expire. A trusted certificate supports a particular identity claim; it doesn't vouch for a business's honesty or the safety of everything that business supplies.
- Make a stolen password useless without the key in your hand.
- Sign in with a tap instead of typing a code.
- Protect Google, Microsoft, Apple and more than 1,000 other accounts.
How Public Keys Help a Website Connection
Another use is key agreement, in which two parties establish shared secret material through a cryptographic exchange. They don't simply send the final secret across the connection for everyone to read.
HTTPS, the protected form of web communication, uses Transport Layer Security, or TLS. A protocol is an agreed set of communication rules. In a certificate-based TLS 1.3 connection, public-key methods help check the server's identity and establish the protected connection. Symmetric encryption then protects the application traffic, such as the web page and information you submit.
That means the website's public key isn't used to encrypt every byte you send. TLS also supports connection setups that rely on previously established secrets, so not every connection repeats the same certificate exchange. These distinctions appear in the TLS 1.3 specification.
Why the Private Half Matters
Appropriately chosen public-key systems are designed so that working out the private key from the public one is beyond practical computing effort. That depends on the algorithm and its settings; it isn't a promise that the mathematics can never be defeated.
Stealing the private key bypasses that problem. Someone who obtains a signing key can generate signatures with it. Someone who obtains a decryption key may be able to read material protected for that key.
A password may help protect access to a stored private key, but it isn't the key itself. Changing that password won't make a stolen copy of the key disappear. Other people may still trust the corresponding public key, so recovery has to address that trust as well as the secret that was lost.
Private Keys: The Secret Half Has Different Jobs

Digital Certificates: What Your Browser Can Actually Verify

Digital Signatures: What a Verified File Actually Tells You

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

