# How do Public and Private Keys Work?

Public and private keys are the key concepts of asymmetric cryptography - a method used to protect identities and data from unauthorized access. Using a cryptographic algorithm, the keys are mathematically connected in such a way that you can derive the public key from the private key, but you cannot take the public key and get its paired private key.
© Photo by cottonbro from Pexels

Public and private keys are the key concepts of asymmetric cryptography – a method used to protect identities and data from unauthorized access. Using a cryptographic algorithm, the keys are mathematically connected in such a way that you can derive the public key from the private key, but you cannot take the public key and get its paired private key.

## Asymmetric Encryption

Together, the two keys are used to encrypt and decrypt messages. If you encrypt a message using a person’s public key, the message can only be decrypted by the recipient using the matching private key. Thus, encrypted messages can only be read by their intended receiver. The advantages of asymmetric encryption also include the ability to ensure the identity of the sender.

## Private Keys and Cryptocurrency

So, how does this apply to Defi and cryptocurrency? To own crypto, you need a wallet to store your coins. The wallet has a unique address comprised of a string of random numbers and letters. This address is a compressed and shortened version of the public key. The private key acts as your digital signature, which can be used to prove ownership of coins in the wallet. While anyone can send transactions to the public key, you need the private key to “unlock” them and prove that you are the owner of the cryptocurrency received in the transaction.

Let’s take a scenario when Alice wants to send Peter some bitcoin. First, Alice needs to get Peter’s public address, which is a shorter form of his public key. She then signs the message with her private key to ensure that the transaction has not been modified. The transaction is then encrypted and verified. Peter would then decrypt the message using his private key and access the coin. Once again, Peter must keep his private key a secret because anyone that has access to that private key will also have access to any associated cryptocurrency.

## Coin Burning

Finally, public and private keys are related to “Coin Burning” – a procedure used to increase and stabilise the value of coins and tokens. To remove a certain quantity of a token from the circulating supply, miners and developers send coins to a public key address without an obtainable private key (Burn address). Without access to a private key, no one can use these coins in a transaction, thus the coins are effectively unrecoverable.

This article compares the public key with an the email address and the private key with the password. Can you think of other examples that function in a similar manner to public and private keys? Share them in the comments.