Security and scams · Explainer
Public and Private Keys: How Cryptography Works
Public keys can be shared; private keys must stay secret. Learn how key pairs support encryption, digital signatures and crypto wallets, and how to protect the keys that control your assets.
By the DappsAtlas editorial team · Updated

What are public and private keys?
Public-key cryptography, also called asymmetric cryptography, uses a mathematically linked pair of keys. The public key is meant to be shared. The private key is secret and should be accessible only to its owner or an authorized system. The pair lets people communicate securely or check who authorized a message without sharing the secret key itself.
The keys are numbers, usually represented in software as long strings of characters. Cryptographic algorithms create the pair so that certain operations can be performed with one key and checked or reversed with the other. The relationship is designed to make it practical to use the public key while making it computationally infeasible to work out the private key from it, provided the algorithm and key size are secure.
The two keys have different jobs, but not every system uses them in exactly the same way. Public-key cryptography can support encryption, digital signatures, or both. In cryptocurrency, the most important role is usually signing: a private key authorizes an action, and other people or software can verify that authorization using the corresponding public key. Keeping the private key safe is therefore essential wherever it controls access to accounts, funds or data.
How does a key pair work?
A key pair is created together using a cryptographic algorithm. The public key can be distributed, while the private key is kept secret. The system relies on a one-way mathematical relationship: it is straightforward to use the private key to produce certain results, but reversing that process to discover the private key from the public key should be infeasible with current computing methods and a secure algorithm.
Think of the public key as information that helps people interact with you, and the private key as the secret that lets you perform an action on your behalf. This is only an analogy; keys are not physical locks, and the details depend on the cryptographic system. In practice, software performs the calculations, so users typically see a wallet address, a signature request or a certificate rather than the underlying operations.
A private key is not a password that can simply be reset through a central service. In a self-custody wallet, the person who controls the key can authorize transactions. If the key is lost and there is no backup or recovery mechanism, access may be lost. If someone else obtains it, they may be able to act as the owner. That is why secrecy, careful backups and a clear understanding of recovery options matter.
How is encryption different from signing?
Public-key cryptography can also protect information in transit. In a basic encryption model, someone encrypts a message using the recipient’s public key, and only the matching private key can decrypt it. Because the public key can be shared openly, the sender does not need to obtain the recipient’s secret key first.
Real systems often combine asymmetric and symmetric cryptography. Public-key methods can help establish or protect a temporary symmetric key, while symmetric encryption handles the larger flow of data more efficiently. Secure connections between websites and browsers commonly use a combination of techniques, along with certificates that help verify the identity of the website.
Encryption and signatures solve different problems. Encryption aims to keep information confidential so unauthorized people cannot read it. A digital signature helps verify authorization and detect changes; by itself, it does not hide the signed message. A system may use both, but one does not automatically provide the other. This distinction is useful when assessing claims about a service or blockchain: a transaction signed by a private key may be publicly visible, even though the key itself remains secret.
How do keys work in a crypto wallet?
A crypto wallet is software or hardware that helps you manage keys and authorize blockchain transactions. The wallet may store private keys directly, protect them with device security, or use a recovery phrase to recreate them. When you approve a transaction, the wallet signs it with the relevant private key and sends the signed transaction to the network. A properly designed wallet does not need to disclose the private key to the blockchain.
With a self-custody wallet, you or your chosen security setup controls the key material. You are responsible for protecting it and understanding how recovery works. With a custodial service, a company controls keys or manages access on your behalf; that can change the recovery process and introduces dependence on the service. “Wallet” can describe both kinds, so check who actually controls the keys rather than relying on the label.
A seed phrase, also called a recovery phrase, is not simply another name for a public key. It is a human-readable backup from which wallet software can derive one or more private keys. Someone who obtains the phrase may be able to restore the wallet elsewhere and control its assets. Store it securely, do not share it, and do not type it into a site or app unless you deliberately initiated a trusted wallet recovery.
Is a public key the same as a wallet address?
A public key and a wallet address are related, but they are not always the same thing. Many blockchain addresses are derived from a public key using hashing or other transformations. An address is usually the shorter or more convenient identifier you share when receiving assets. The exact design varies by blockchain and account type, so an address format on one network may not work on another.
Sharing a receiving address is generally safe in the sense that it does not give someone the private key or direct authority to spend your funds. However, public blockchains often make activity associated with an address visible. Sharing it can therefore reveal transaction history or connect activity to your identity, depending on what others know. Use care when posting addresses publicly if that privacy matters to you.
Do not assume that every address can be converted into a public key at all times. Some networks reveal a public key only after an account has signed or sent a transaction, while others use different account structures. What matters for safety is the distinction between a public identifier, which can be shared for receiving or verification, and the private key or recovery phrase, which must remain secret.
How can you protect private keys?
Protect private keys and recovery phrases as high-value secrets. Keep backups in a secure place that is not exposed to ordinary online accounts, and consider what would happen if a device were lost, damaged or accessed by someone else. A hardware wallet can keep key operations isolated from an internet-connected computer, but it does not prevent every mistake: a user can still approve a harmful transaction or reveal a recovery phrase.
Use a wallet or key-management tool from a source you can verify, keep devices and software updated, and secure associated accounts with strong, unique passwords and multifactor authentication where available. Check the wallet’s address and transaction details on its own display when supported. Do not photograph or paste a recovery phrase into cloud notes, email, chat or an online form.
Before signing, pause and review what the request does. A transaction may transfer assets, interact with a contract or grant an allowance that lets another address move tokens later. If a request is confusing, unexpected or presented under pressure, do not approve it until you understand it. Never share a private key or recovery phrase with a person claiming they need it to verify, repair or unlock your wallet.
What should you do if a key is lost or exposed?
If you think a private key or recovery phrase has been exposed, assume that anyone who saw it may be able to use it. If the wallet still has assets, create a new wallet with a fresh recovery phrase using a trusted device and move assets to it as soon as you can do so safely. Do not reuse the exposed phrase, and do not follow instructions from someone who contacts you offering to recover funds.
If a transaction has already been signed, check the wallet and network using trusted tools to understand what happened. You may be able to revoke a token allowance or take other protective steps, but actions vary by chain and contract. Revoking an allowance does not reverse a completed transfer, and it may require another transaction. Seek help from the wallet provider through a channel you independently know is legitimate; never give support staff your secret phrase.
If a key is lost rather than exposed, recovery depends on whether you have a valid backup or a custodial provider that can restore access. There is no universal reset for a self-custody private key. Avoid anyone who guarantees recovery in exchange for your phrase, payment or remote access. Protect any remaining backup and assess what other accounts or wallets might share the same compromised secret.
What are the key takeaways?
Public-key cryptography is a foundation for secure digital communication and blockchain authorization, but it does not make every system private or safe. A public key can be shared without giving away the matching private key. That secret key can create signatures, decrypt certain messages or authorize actions, depending on the system. In crypto, it commonly provides control over an account’s assets.
Three practical rules cover many everyday situations:
- Share a receiving address only when you intend to receive or identify activity; never confuse it with a secret credential.
- Keep private keys and seed phrases private and backed up securely. No support agent or website should need them to diagnose an ordinary problem.
- Review each transaction or signature before approving it. Cryptography can verify that you authorized an action, but it cannot decide whether that action was a mistake or a scam.
When evaluating a wallet, understand who controls the keys, how the wallet is recovered, and what information a signature request will authorize. When evaluating an encrypted service, distinguish confidentiality from authentication and signing. These checks do not eliminate risk, but they help you make informed decisions without relying on vague claims that a product is simply “secure.”
Frequently asked questions
What is the difference between a public key and a private key?
A public key is designed to be shared and can help others encrypt data for you or verify your digital signature. A private key must remain secret because it can decrypt certain data or create signatures that prove control of the matching key pair.
Is a wallet address the same as a public key?
No. A crypto wallet’s public address is usually derived from a public key, often through additional cryptographic steps. It is safe to share your address to receive assets, but it does not let someone spend them.
Is a seed phrase a private key?
A seed phrase can generate or restore the private keys for a wallet, so anyone who gets the phrase may be able to control its assets. Keep it private and offline; never enter it into an unexpected website or share it with someone claiming to provide support.
Does public-key cryptography make blockchain transactions private?
No. In many blockchains, transactions and account data are publicly visible, even though signatures prove that a transaction was authorized by someone with the private key. A key pair provides control and verification, not automatic secrecy for everything recorded onchain.
What should I do if my private key is exposed?
If you suspect a private key or seed phrase has been exposed, treat the wallet as compromised. If possible, use a trusted device and a newly created wallet with a new secret to move remaining assets, and do not reuse the exposed phrase.
Mentioned in this guide
dApps in this guide
The Real Review is a wine and food publication for readers seeking reviews, winery rankings and regional wine classifications.
Keep reading
Related guides
Token · Explainer
What Is a Cryptocurrency Index? How It Works
A cryptocurrency index measures the performance of a defined group of crypto assets. Learn how indexes are built, how they differ from funds, and what to check before using one as a benchmark or investment.
Security and scams · Explainer
Aavegotchi Fakes: How to Verify a Real Gotchi NFT in 2026
Aavegotchi is an NFT game and DeFi protocol, so copies and impersonators are a real risk. This guide explains how to confirm that a Gotchi is genuine, avoid fake listings, and check claims about physical NFT art before you pay.
Security and scams · Explainer
Bored Ape Yacht Club Scams: How They Work and How to Avoid Them
Bored Ape Yacht Club scams usually target holders and buyers through hijacked social accounts, fake airdrops, and wallet approval phishing rather than the NFT contracts themselves. This guide explains the common methods, the warning signs, and the steps to take to protect your NFTs.
Security and scams · How-to
How to Find Memecoins Early and Detect Token Scams
Memecoins can multiply or vanish within hours, and most new launches are built to take money rather than hold value. This guide covers how to find new tokens, run basic safety checks and avoid the most common scams.
Security and scams · Explainer
QiDao Superfluid Contract Exploit: What Happened in 2026
The QiDao exploit that drained about $13 million shows how one faulty contract can put users at risk across connected DeFi apps. This explainer covers what happened, what the record does and does not confirm, and the defensive steps you can take now.
Security and scams · How-to
How to Protect Your Seed Phrase From Scams: A 2026 Guide
A seed phrase gives full control of a crypto wallet, so anyone who learns it can move the funds in it. This guide explains the common scam patterns, safer storage and restore habits, and what to do if your phrase may have been seen by someone else.
Security and scams · Explainer
Rug Pulls in 2026: Why They Cost More and How to Spot Them
Rug pulls take many forms, from a developer draining a liquidity pool to a token that cannot be sold. This guide explains how they work, why losses are rising, and which checks reduce your risk before and after you buy.
Security and scams · How-to
How to Prevent Wallet Drainer Scams in 2026
A wallet drainer tricks you into signing a transaction or sharing a secret that hands over your tokens. This guide explains the habits and checks that keep your funds under your control.