What Is A Cryptographic Key?
A cryptographic key is a string of numbers and letters used to alter a message into/out of a cipher through an algorithm. Public-key cryptography (PKC) uses a pair of public keys and private keys, getting its name because it can either lock or unlock the data being encrypted like a key.
Cryptography is secured by mathematical functions, the difficulty of the problem determines how strong your protection is. PKC uses trapdoor functions, which are easy to solve in one direction, and near impossible to reverse the function.
What Is A Public Key?
A public key is what allows you to receive cryptocurrencies. Anyone can see and send cryptocurrencies to your public address, but to access the coins inside, the private key linked to the public key is needed. When created, it is extremely long, therefore it is hashed to compress the key into what is called a public address.
The public address is similar to a bank account allowing peers to send and receive cryptocurrencies, but only those with the key to the house can access the coins.
What Is A Private Key/Secret Key?
A private key is the password of a wallet, when combined with the public key it grants access to the coins inside of a wallet and what happens to them. Therefore private keys are extremely long numbers being stored off-chain, within the wallet that they unlock.
At the creation of a wallet, the private key creates the public key using the aforementioned trapdoor function. If you happen to lose access to your own wallet, there is nothing no one can do to help you. Your private key should never be shared with anyone and should be kept offline on something like paper.
Private keys come in various forms such as 256-bit codes, 64-digit hexadecimal codes, mnemonic/seed phrases, and QR codes.