Published in


Cryptography in Blockchain Explained

The meaning of ‘crypto’ in cryptocurrency

Photo by Pierre Borthiry on Unsplash

First, the basics, blockchain is a peer-to-peer network. The word ‘blockchain‘ is made up of two separate terms, ‘block’ and ‘chain’. A ‘block’ is referred to as a collection of data, and ‘chain’ is referred to a public database of these blocks, which is further, stored as a list.

Now, these lists are linked using cryptography, which makes it the most essential and fundamental requirement for creating a blockchain.

As we all know, blockchain is a growing list of records, and the blocks get appended to the list over a period of time. This factor alone makes cryptography more important than ever.

TLDR; Here’s the summary video just in case you need it.

What is Cryptography

By concept, it is a method of developing techniques and protocols to prevent a third party from accessing and gaining knowledge of the data from the private messages during a communication process.

The word Cryptography is made up of two ancient greek terms, Kryptos having meaning “hidden” and Graphein having meaning “to write”.


  • Encryption: It is a process of plaintext (normal text) to a ciphertext (random sequence of bits).
  • Key: A small amount of information is required to induce the output of the cryptographic algorithm.
  • Decryption: The inverse process of encryption, conversion of ciphertext to plaintext.
  • Cipher: The mathematical function, i.e. a cryptographic algorithm which is used to convert plaintext to ciphertext.

Types of Cryptography

Fundamentally, there are mainly three different ways one can perform cryptographic algorithms,

1. Symmetric-Key Cryptography

  • In this encryption method, we take a single key into application.
  • This common key is used for both the encryption as well as the decryption process.
  • Using a common single key creates a problem of securely transferring the key between the sender and the receiver.
  • It is also called Secret-Key Cryptography.

2. Asymmetric-Key Cryptography

  • This encryption method uses a pair of keys, an encryption key, and a decryption key, named public key and private key respectively.
  • The key pair generated by this algorithm consists of a private key and a unique public key that is generated using the same algorithm.
  • It is also called Public-Key Cryptography.

3. Hash Functions

  • It doesn’t make use of keys.
  • It uses a cipher to generate a hash value of a fixed length from the plaintext.
  • It is nearly impossible for the contents of plain text to be recovered from the ciphertext.
Photo by Markus Spiske on Unsplash

Role of Cryptography in Blockchain

Blockchains mainly make use of two types of cryptographic algorithms,

  1. Asymmetric-key algorithms
  2. Hash functions

Hash Functions

Hash functions are used to provide the functionality of a single view of blockchain to every participant. And generally, blockchains use the SHA-256 and RIPEMD-160 hashing algorithm as their hash function.

Why Use Cryptographic Hash Functions

Well, cryptographic hash functions provide the following benefits to the blockchain,

  1. Avalanche effect — i.e., a slight change in the data can result in a significantly different output.
  2. Uniqueness — i.e., very input has a unique output.
  3. Deterministic — i.e., any input will always have the same output if passed through the same hash function.
  4. Quickness — The output can be generated in a very small amount of time.
  5. Reverse engineering is not possible, i.e. we cannot generate the input by having the output and the hash function.

Further, hash functions have a major role in linking the blocks to one another and also in maintaining the integrity of the data stored inside each block. Any alteration in the block data can lead to inconsistency and break the blockchain, making it INVALID. This requirement is achieved by the property of the hash functions, called the ‘avalanche effect’.

It’s this feature that makes the data reliable and secure on the blockchain. And any changes in the block data will lead to this difference in hash value and make the blockchain invalid, making it immutable.

Asymmetric-Key Cryptography

It is where the private key generally needs to be produced by a random number algorithm, and the public key is calculated by executing an irreversible algorithm.

The asymmetric encryption algorithm has the advantage of having separate public and private keys, which can be transferred over unsecured channels.

Likely, it also has several disadvantages, some of them being low processing speed and unsatisfactory encryption strength. Also, It is very much necessary to ensure the security of the asymmetric encryption algorithm during the transmission of data on the blockchain.

Digital Signatures

One of the major parts of asymmetric-key cryptography is digital signatures. And for those who don’t know, Digital signatures provide integrity to the process; as they are easily verifiable and cannot be corrupted.

Photo by Scott Graham on Unsplash

They also hold the quality of non-repudiation, making them similar to the signatures in the real world. Further, It is these digital signatures, which ensure that the blockchain is valid and the data is verified and correct.

A Perspective

Hashing, public-private key pairs, and the digital signatures together constitute the foundation for the blockchain. These cryptographic features make it possible for blocks to get securely linked by other blocks, and also ensure the reliability and immutability of the data stored on the blockchain.

There are a huge number of applications of blockchain technology, and it is cryptography that makes all of them possible. One of the major real-world applications is cryptocurrencies.

But you may ask, HOW? Let me explain.

Cryptocurrencies are one of the major applications of blockchains, and they use public-private key pairs to maintain the addresses of the users on the blockchain. For cryptography in blockchain, the public key is used as the address of the person.

Take a note that the public key is visible globally, i.e. it is visible to any participant of the participant. Whereas the private key is a secret value and is used to access that address data and authorize any of the actions for the ‘address’, which are generally regarded as transactions.

Digital signatures are widely used for cryptocurrencies as well. They are used to approve transactions by signing them securely (i.e. offline) and are also used for multi-signature contracts and digital wallets on the blockchain.

This further helps to perform any action from these multi-signature contracts and digital wallets, but do account for the fact that the digital signatures from multiple (i.e. different) private keys are required before any action to be executed.

Sign up for this Blockchain Certification for Beginners and kickstart your journey into this new emerging technology!


Lastly, as a conclusion, I’d like to say that Cryptography in the blockchain is the core of this technology, making it immutable and reliable. If you are someone who wants to build a mainstream career in this field, I’d recommend you to have a strong understanding of cryptography and its working.

You may also like,




Stories, Insights, & Plans to Help You GROW your business!

Recommended from Medium

The 3C’s of Community Investment

Osasion Weekly Report #50(November 22nd — November 28th)

Autonomously Farming Sushi On Polygon with

The Ethfinex Team

Tokenomics And Roadmap LambSwap Token

NEAR VISION #3: Why are scalable blockchains like NEAR necessary?

LBank AMA Recap with SPACEMINE

Lending and Borrowing in Free TON: Contests and Developments

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Amarpreet Singh

Amarpreet Singh

Startup Scientist who’s passionate about problems. Entrepreneur #Brandlitic + If you need Digital Marketing, SEO, Social Media, Motivation, hit [Follow]

More from Medium


Learn Blockchain | Part 7 | The Last Part Of Blockchain Learning

Making Web3 Safer with FYEO