# How Does Blockchain Encryption Use Public key Cryptography?

**Blockchain Encryption:** Asymmetric cryptography, or public cryptography, is an integral part of cryptocurrencies like Bitcoin and Ethereum. These advanced cryptographic techniques guarantee that the source of the transaction is legitimate and that hackers cannot steal a user’s money. Here’s a complete look at how blockchains do this with public-key cryptography:

**What is public-key cryptography (Blockchain Encryption) ?**

Public key cryptography is a cryptographic system creates on a pair of keys, a private key kept secret, and a public key transmits over the network. This system makes it possible to ensure the authenticity and integrity of a message using advanced cryptographic techniques.

Here is an example of how public-key cryptography can be uses in practice. Suppose a user, Alice, wants to send Bob over an undependable communication channel such as the Internet. Alice could use public-key cryptography by generating a series of public and private keys. She could then publish her public key to Bob. When she wants to communicate with Bob, she can add a digital signature to her private key message. It would show that she is the creator of the message. Bob can check this using the received message and Alice’s publickey.

**Publickey cryptography in Bitcoin (Blockchain Encryption)**

Publickey cryptography is an integral part of the Bitcoin protocol. And is uses in numerous places to safeguard the integrity of messages create in the protocol. The making and signing of transactions in wallets, which are the essential components of any currency, rely heavily on public-key cryptography. The Bitcoin protocol uses the so-called ECDSA (Elliptic Curve Digital Signature Algorithm) algorithm to create a new set of private keys and consistent public keys. The publickey is then use with a hash function to make the public address that Bitcoin users use to send and receive money. The private key is kept secret, and it is uses to sign a digital transaction to ensure that the transaction’s origin is legitimate.

**Digital signatures**

Digital signatures are very similar to the actual signatures on a document. They make it possible to guarantee that the author of a transaction is indeed the person who holds the private key. Digital signatures are the back bone of Bitcoin. And each transaction has a different digital signature that depends on the user’s private key. Considering the message, the user’s public key, and the signature, it is not trivial to verify that it is genuine. Formally, digital signatures depend on the two functions :

**Sign (message, private key) —> signature**

Given message we want to sign and a private key, this function creates a unique digital signature for the message.

**Verify (message, public key, signature) —> correct / incorrect**

Considering the message we want to verify, the signature and the public key, this function will produce a binary output depending on whether the signature is genuine.

Once the owner signs the transaction, it is sent to the storage pool, stores for processing by miners. Minors use the sender’s public key to ensure that the digital signature is genuine. So that a hacker cannot spend a user’s money without their consent. When ownership and digital signature are checks out, the transaction is adds to the next block. And money is sent from the one wallet to another wallet.

**Proof of work**

The other main application of cryptography in the **Bitcoin protocol** is the computation of the proof of the work function. Miners depend on computing the “SHA256 hash function” on many inputs until they find the nonce for a particular block before adding it to the blockchain. Several zeros change the difficulty of mining process the hash must start with to be adds to the blockchain. It is a unique system that adjusts up and down depending on number of people mining at any given time. From IT perspective, it is also impossible for the attack provider to change transactions that have already been recorded in a blockchain.

**ALSO READ: Guide To ADA And Cardano: What Is Cardano And Its Boom (Cardano News)**