# Cryptography Concepts in Blockchain

### What is Cryptography?

Cryptography is the method of developing techniques to secure data in communication between peers through the code. This technique can increase the data integrity of the blockchain network. The prefix “crypt-” means “hidden” or “vault” — and the suffix “-graphy” stands for “writing.” Here are important terms to know:

Encryption– It is the process of converting a plain text into a random number or ciphertext.

Decryption – It is the process of converting Random number or ciphertext into plaintext (It is a reverse process for Encryption).

Cipher – Is the cryptography algorithm used to convert plain text into ciphertext.

### Different type of cryptography methods

1. Symmetric Key Cryptography
2. Asymmetric Key Cryptography
3. Hashing Methods

Blockchain makes use of these cryptography techniques in multiple ways – wallets, transaction, Security.

#### What is Symmetric Key Cryptography in Blockchain

In this type of cryptography, We use a common key for both the encryption and decryption process. Using a common key for both the process would consider being less secure.

#### Asymmetric Key Cryptography in Blockchain

In this process, we use two different keys called Public and private key for the encryption and decryption. This process also called as Public-key cryptography. In the blockchain, Public key is like an address of the user and a private key is a secret key to prove the ownership of the wallet.

How this public key cryptography works.

Let’s say A want send an encrypted message to B

• A uses B public key to encrypt the message.
• A sends the encrypted message to Bob – After the encryption process, all they would see is random numbers and letters.
• B uses his private key to decrypt and read the message

##### Hashing Methods

Hashing is a cryptography process which takes an input string of any length and produces a fixed-length output. Even small changes in the input will drastically alter the output. You don’t find any similarities in output. It all have unique strings. So for securely transferring data in the blockchain, we use Merkle tree hashing method

It is the fundamental structure of the blockchain and increases the immutability of the network.