**Cryptography In blockchain**

In the **blockchain**, it is a **peer-to-peer network**. The term blockchain is split into 2 words that are “blocks” and “chain”. Where the block is represented as a collection of data and the chain is referred to as a public database of these blocks and that are stored in a “List”.

Here the lists are linked by using a list that is essential and fundamental and that is created by a **blockchain**.

Over a while, **blockchain** is appended and this is the growing list of records. So this way cryptography is more important than ever.

**What is cryptography?**

During a communication process, the private message gains some knowledge and prevents the accessing from the third party.

The word cryptography comes from the word “Krypto” which is the meaning of “Hidden” and the word “Graphy” is the meaning of “Write”.

**Terminologies:**

- Key
- Encryption
- Cipher
- Decryption

**Key** — This is the small amount of information that is induced with the cryptographic algorithm.

**Encryption** — Where the plain text is converted into a ciphertext.

Eg: 1.Alice sends an (Hai) message to Bob (using an encryption model)

2.Bod sees the message that is like some code (aab) they convert the message into the description by using some code then only they see the original message (Hai).

**Cipher — **By using a cryptographic algorithm that is used in a mathematical function they convert the plain text into ciphertext.

**Decryption — **Convert the ciphertext into plain text. The reciprocal of encryption.

**Types of Cryptography:**

- Symmetric Cryptography
- Asymmetric Cryptography
- Hash Function

**Symmetric Cryptography:**

Symmetric cryptography is the single key that is used in the cryptographic algorithm. Where the single key is used securely transferring between the user and sender (The transaction is secure between the user and the sender). Then the symmetric key is also called a secret key. This key is used in both the decryption encryption process.

**Asymmetric Cryptography:**

In this asymmetric cryptography, they have a pair key that name is encryption key and also a decryption key that is used in the cryptographic algorithm. Where the key is generated and that consists in the algorithm they are a private key and also a unique public key. This is also called public-key cryptography.

**Hash Function:**

It doesn’t use the key. That uses the ciphertext to generate the hash value which is from the length of the plain text. The content of the plain text is recovered from the ciphertext.

**In ****Blockchain**** — The role of Cryptography:**

- Asymmetric-key Cryptography
- Hash function

**Hash function:**

At every blockchain method, the value of the hash function is SHA-256 and the RIPEMD-160 in the hashing function algorithm. This provides a single view of the functionality of blockchain in every participant.

**Using Of Hash Function in Cryptographic Algorithm:**

The following benefits of the algorithm are:

- Quickness
- Deterministic
- Avalanche Effect
- Uniqueness
- Reverse Engineering is not Possible

**Quickness: **At a very small amount of times the output will be generated.

**Deterministic: **Passing through the hash function every input has the same output.

**Avalanche Effect: **There are slight changes in the data and the output is different from that.

**Uniqueness: **Every input has a unique output

**Reverse Engineering is not Possible: **by having the output and the hash function we cannot generate the input.