Blog_Banner_Asset
    Homebreadcumb forward arrow iconBlogbreadcumb forward arrow iconBlockchain Technologybreadcumb forward arrow iconWhat are Hashing, Signatures and Public-Private Keys

What are Hashing, Signatures and Public-Private Keys

Last updated:
16th Jan, 2019
Views
Read Time
6 Mins
share image icon
In this article
Chevron in toc
View All
What are Hashing, Signatures and Public-Private Keys

Once you know what is blockchain technology, you understand that the sealing mechanism is the key to the successful and accurate maintenance of a blockchain. But how can these stringent requirements be fulfilled?
The conditions imposed on the sealing mechanism of a blockchain are satisfied using a hash function.

Learn Online Software Development Courses from the World’s top Universities. Earn Executive PG Programs, Advanced Certificate Programs or Masters Programs to fast-track your career.

The mathematical definition of a hash function is a function that takes a variable length numerical input and returns a number of fixed length as output. In order to work with strings of characters, ASCII codes can be used to convert characters into integers and vice versa. The output returned by the hash function is known as the hash value. Most popular hash functions have a fixed hash value size lying between 160 and 512 bits.
All blockchains impose target conditions on the output of the hash function when a block is an input to it. To fulfil these target conditions, a seal is computed and concatenated to the block being stored. This seal encrypts the contents of the block and preserves their integrity. This is because any change to the block would drastically change its corresponding hash value, and cause it to escape the target conditions. The computed seal is commonly known as a nonce. A common target condition that the nonce must satisfy is ensuring that the leading ‘n’ characters of the output hash be zero. The value of ‘n’ sets the level of difficulty in the blockchain, which may be adjusted periodically as per the requirements of the network.
Blockchain Applications in Supply Chain

Explore Our Software Development Free Courses

Check out our free courses to get an edge over the competition 

Ads of upGrad blog

There are three important properties that hash functions must satisfy in order to be used effectively in the blockchain. Given the hash value output by the function, it must be computationally difficult to find any input that, when hashed, returns the given output. This is known as pre-image resistance. In other words, the hash function should be computationally expensive to reverse. Similarly, given the input to the function, it must be difficult to compute any other input to the same function that outputs the same hash value as the original input. This is known as collision resistance. However, given any input to the hash function, it should be easy to compute the corresponding value output by the hash function. This is to ensure easy verification of the integrity of the contents of the blockchain.

Explore our Popular Software Engineering Courses


The first two properties given above are critical because they slow down the rate of computation of the nonce, or proof of work. This causes the rate at which blocks are added to the chain to be limited by the rate of computation of the nonce, and not the rate at which transactions occur. This is absolutely crucial because it prevents dishonest individuals in the network from generating and adding blocks of false transactions to the chain at a quicker rate than the network itself. This is because a single individual cannot compete with the computing power of a large network, and thus the longest chain of blocks always belongs to the majority in the network itself.
This allows us to be able to safely accept the longest chain as the real blockchain under the assumption that the majority in the network is honest. The vulnerabilities of a blockchain in the case of a dishonest majority have already been discussed in a prior article.

In-Demand Software Development Skills

Check out upGrad’s Java Bootcamp 
Applications of Blockchain in Healthcare

There are many different forms of hash functions that are used in cryptography. MD5 is the most popular hash function of the Message Digest family, which also consists of MD2, MD4 and MD6. The SHA family, consisting of SHA-0, SHA-1, SHA-2 and SHA-3, is another popular set of algorithms used for hashing. RIPEMD and Whirlpool are other common hash functions. These functions all implement different techniques to obtain the properties of pre-image and collision resistance.
The sealing mechanism of the blockchain ensures that transactions cannot be falsified after the blocks have been added to the chain. But how are any imposters in the network prevented from faking a transaction between two members of the network? In other words, how can the identity of the members involved in the transaction be verified in an anonymous network distributed across the globe?

upGrad’s Exclusive Software Development Webinar for you –

SAAS Business – What is So Different?

Verification of any transaction conducted in a blockchain network requires a digital signature.
Each member of the blockchain network is assigned a public key and a private key. The public key of each member is known to all members of the network, but the private key remains secret and is known only to the individual it is assigned to. Any message encrypted using the private key of a member node can only be decrypted using the corresponding public key of the pair, and vice versa. This allows nodes to approve transactions by signing them with their private key. This can now only be decrypted by their corresponding public key, thus verifying them as the senders. The transaction can similarly be encrypted by the receiver as well in order to confirm their involvement in the transaction.
7 ways Blockchain is Revolutionizing the Automotive Industry

Check out upGrad’s Full Stack Development Bootcamp (JS/MERN) 

Ads of upGrad blog

This mechanism allows nodes to authenticate transactions by verifying the identities of the nodes involved while still maintaining their anonymity. The digital signature and the concept of public and private keys prevents other nodes from making false transactions on your behalf even in the event of a 51% attack. Thus, it is an elegant way of ensuring the security as well as the anonymity of individual members of the network.

Read our Popular Articles related to Software Development

If you are interested to create blockchain applications from scratch, check out upGrad & IIIT-B’s Executive Certification in Blockchain from IIITB.

Profile

Drish Mahnot

Blog Author
Drish is a Consultant working with the Program team at UpGrad. He is currently pursuing his B.Tech from IIT Bombay and enjoys writing technical blogs in his free time.
Get Free Consultation

Selectcaret down icon
Select Area of interestcaret down icon
Select Work Experiencecaret down icon
By clicking 'Submit' you Agree to  
UpGrad's Terms & Conditions

Our Popular Blockchain Course

Frequently Asked Questions (FAQs)

1What will a tamper-proof ledger entail?

The importance of a transparent and tamper-proof ledger cannot be overstated. All transactions would be completely transparent and accountable as a result of this. It would also guard against tampering with the ledger, ensuring its accuracy. It will also make it easier for businesses to track their supply networks and detect fraudulent activity. It might also be used to keep track of voting records and other critical information. It will enable businesses to track and save their information digitally without fear of being hacked.

2What are some potential applications for blockchain in the area of supply chain management?

Blockchain has a wide range of possible uses in supply chain management. Tracking the flow of goods, minimizing the risk of counterfeit goods, reducing the risk of food fraud, and assuring the quality of commodities are some of the most significant applications. Businesses may increase the overall efficiency of their operations by employing blockchain technology to streamline supply chain activities. Furthermore, blockchain can assist firms in swiftly and simply identifying the cause of any supply chain issues.

3What are the security implications of a distributed ledger?

A distributed ledger has serious security considerations. A distributed ledger is a database distributed across several computers or servers. A hacker would have to enter many systems to obtain access to the data, making it difficult for them to attack the system. Furthermore, a distributed ledger is transparent and can be accessed by anyone with network access. Criminals will find it more challenging to conduct fraud or hide their activities as a result of this. Financial transactions will be easier to audit, and criminals will be easier to trace down. Individuals can also utilize a distributed ledger to build a digital identity that can be used to validate their identity online. The bottom line is that it will make most of the data that businesses handle more secure.

Explore Free Courses

Suggested Blogs

Top 20 Highest Paying Blockchain Jobs in India [A Complete Report]
902622
Blockchain is an emerging job skill in the IT industry. Technological advancements are gradually bringing this distributed ledger technology to the ma
Read More

by Mayank Sahu

22 Jul 2024

Top 10 Interesting Blockchain Project Ideas for Beginners/Students [2024]
183176
Summary: In this Article, you will learn top 10 interesting blockchain project Ideas for beginners. Trusted Crowdfunding Platform Using a Smart Cont
Read More

by upGrad

18 May 2024

Prerequisites to Learn Blockchain Technology: It’s Not What You Think It Is
55325
There has been a massive development in the field of Blockchain technology in the last decade. Many people and companies came to know about Blockchain
Read More

by Mayank Sahu

16 May 2024

Blockchain vs Cloud Computing: Difference Between Blockchain and Cloud Computing
13678
Introduction Cloud computing and blockchain technology are the two on-demand technologies that are booming in the modern market and are being used by
Read More

by Mayank Sahu

25 Feb 2024

Skills Needed to Become a Blockchain Developer
54899
Blockchain development is one of the fastest-growing sectors. Companies are looking for blockchain developers to make new implementations, advance the
Read More

by Mayank Sahu

Blockchain Developer Salary in India 2024 [For Freshers & Experienced]
903898
The Blockchain Era is has arrived, and it is now. Enterprises across various sectors of the industry are warming up to the concept of the decentralize
Read More

by upGrad

11 Feb 2024

Blockchain Applications in Supply Chain
5878
The distributed-nature technology of Blockchain has disrupted many industries, with its uses and blockchain applications in supply chain leading to in
Read More

by Radhika Maloo

28 Aug 2023

Applications of Blockchain in Healthcare Industry
6825
After taking the finance and business sector by storm, Blockchain applications in healthcare are now all set to radicalize the healthcare industry. Ev
Read More

by Shubham Chakraborty

23 Aug 2023

What is Ripple Blockchain? Everything You Need to Know in 2024
7428
Ripple is a popular name in the tech industry. And Ripple blockchain has created a lot of buzzes. We all know how blockchain is transforming the indus
Read More

by Mayank Sahu

21 Aug 2023

Schedule 1:1 free counsellingTalk to Career Expert
icon
footer sticky close icon