Unblocking the Blockchain: Hashing

Updated on October 10, 2018
hengkiong profile image

Heng Kiong teaches Information Technology, including business analytics and management information systems, at a tertiary institute.

What is Hashing?

From the previous two articles, we learned that Digital Signatures prove that a message originates from a specific person and no one else. Digital Signatures ensure message authentication as they can be used to assure the participants of a transaction that the information originated from the signer and can be trusted.

In this article, we are going to explore the second cryptography concept that is essential in a blockchain network known as Hashing.

The process of applying the Hash function is called "Hashing". Hashing is a confirmation that the output from a Hash function has not been tampered with in any way. Hashing transforms a string of characters into a value that uniquely represents the original string. Bitcoin, for example, uses SHA-256 algorithm to take an input and turn it into a fixed size of 256-bit (32-byte) output. For example,

BLOCKCHAIN - dffdca1f7dd5c94afea2936253a2463a26aad06fa9b5f36b5affc8851e8c8d42

blockchain - ef7797e13d3a75526946a3bcf00daec9fc9c9c4d51ddc7cc5df888f74dd434d1

SHA stands for Secure Hash Algorithm. Blockchain uses 256 bits of information to represent its current state at any given time.

An Analogy

Let us attempt to use bar codes to explain the concept here. A bar code is an image of bars and spaces that is used to identify a particular product. For an example, in a supermarket, a bar code uniquely represents the item which itself is affixed to. However, it is difficult to guess the products by just looking at the bar codes.

Bar codes - Analogy of Hashing
Bar codes - Analogy of Hashing

Verifying the Checksum of Files

In computer security systems, Hashing is used to ensure that transmitted messages have not been tampered with.

Hashing as used in verification
Hashing as used in verification
Hashing used in verifying the integrity of a downloaded file
Hashing used in verifying the integrity of a downloaded file

In situations when you are downloading a file, you may be able to see the checksum values being included, so you can verify if the downloaded file has been corrupted or not. Example:

Download link

Filename: Blockchain_FINAL_040518.mp4

SHA256: 6528d13bc80d1e4603f63face7fed28b462d7eaa735f8f5ccdeb94b914723269

Verifying

Hashing allows one to ensure that the file is identical and that no corruption has occurred during the download.

Once you have downloaded the file, you can verify if the downloaded file and the published checksums match.

In Windows

Use the built-in CertUtil utility

Open the command prompt in Windows

Navigate to the folder of the downloaded file

Run the following command:

C:\>CertUtil -hashfile / SHA256


In Macs

Open Terminal
Run the following command:

shasum -a -256 /Users/<path name>/videos/Blockchain_FINAL_040518.mp4

Command Prompt - DIRectory
Command Prompt - DIRectory
Command Prompt - Hash 256
Command Prompt - Hash 256

Check the SHA-256 hash values to match against the one from the original file.

Characteristics of a Good Hash Function

Hashing has the following characteristics, which makes it suitable for Blockchains.

  1. Difficult to predict what the hash of any input will be until you calculate it.
  2. Computationally Efficient
  3. Collision Resistant – Difficult to find two inputs that match to one same output
  4. Hides Information - Difficult to glean anything useful about the input given the output.
  5. Well Distributed – The output should look random

Hashing in the Blockchain

Blockchain keeps an entire list of transactions by linking together a series of timestamped data records that are immutable. There is no central authority in a Blockchain. Participating parties in a blockchain network need an assurance of trust that a record has not been tampered with or modified in an unauthorised way.

Hashing provides that. It represents the current state of the transactions that have taken place so far.

Hashing in a Blockchain
Hashing in a Blockchain

What's Next

In Blockchain, transactions are linked together in a chronological manner to form a continuous chain of blocks. Hashing provides the security of the data. We will look at how Hashing is being used in Blockchain in the next article.

Hashing is also used in Bitcoin where miners are required to find the hash of the block header to start with a certain number of zeros. We will cover this later.

© 2018 Heng Kiong Yap

Comments

    0 of 8192 characters used
    Post Comment

    No comments yet.

    working

    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, toughnickel.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://toughnickel.com/privacy-policy#gdpr

    Show Details
    Necessary
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
    Features
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Marketing
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Statistics
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)