Hashing in blockchain.

Manas Sav
4 min readJul 28, 2020

Lets begin with hashing~ hashing refers to encryption and decryption of text or any file. The security of the internet depends on encryption. It allows your device and a server to send private messages to each other like your emails, your passwords, pictures, without anyone eavesdropping. Hashing possess a major role to make blockchain more secure. And we know bitcoin is all about exchanging money from one end to another. And it is more likely to make sure that your payments are secure over internet.

Importance of hashing in blockchain

  1. Hashes are used to link blocks together in correct order without disclosing the data inside blocks.
  2. Hashing functions are crucial in crypto mining where a valid nonce is discovered by computing several hashes. This helps to form a consensus on the blockchain.
  3. The use of “hash of the data” helps to store large amounts of data on the . This data is time-stamped and can be hashed for future reference. It makes the permanent data storage less bulky or simply more economical.

There are mainly two kind of hashing techniques:-

  1. Symmetric Hashing
  2. Asymmetric Hashing

Symmetric hashing ~Symmetric-key algorithms also referred as secret-key algorithms use a single or same cryptographic key for encryption and decryption purposes.They convert data in a way that is problematic for an opponent to decrypt the data without the key.

But the problem with symmetric hashing is- if a symmetric-key algorithm is being used by more than one receiver then the key has to be shared with all entities. If the key is compromised from one entity, communication of all the entities will be compromised. Thats why we don’t use symmetric hashing in blockchain. because in blockchain information is passed from all peers connected to network.

Lets understand how asymmetric hashing works on a bitcoin blockchain.

Bitcoin blockchain uses asymmetric key hashing technique. Asymmetric key is a process that uses a pair of keys one public key and one private key to encrypt and decrypt a message and protect it from unauthorised access or use.

A public key can be used by any person to encrypt a message so that it can only be decrypted by the intended recipient with their private key. A private key also known as a secret key it is shared only with key’s initiator.

For better understanding imagine public key as your email id that can be shareable to everybody and private key is just like your password associated to your mail id. Which cant be shared to anyone its only known to you.

Suppose if Alice have to send message to Bob using asymmetric hashing algorithm to archive end to end encryption. In order to send message Alice have to encrypt message with public key (Email id) of Bob and sign it using her private key. Process of signing make sure that message is sent by Alice only. In order to receive message there are many peers present within a network from whom encrypted message is passed. Only the Bob with his private key can encrypt the message which is associated to his public key and read if he had not shared it by anyone.

Say you find this message, Firstly it looks like garbage, but someone tells you the key is that every letter is shifted forward one in the alphabet so to decrypt this message you just shift every letter back one. The keys used to guard your bank details are obviously a lot harder to break but they may not be the much longer.

What makes these codes practically unbreakable is the tremendous amount of time and computing power they take to break. If all the world’s personal computers were working nonstop to try and break the code that keeps your email safe it would take them around 12 million times the age of the universe.

#blockchain #hashing

--

--