All You Need To Know About Cryptography In Blockchain
Cryptography is the foundation of blockchain. This article is an introduction to the topic as well as an argument about its importance!

Tech Lead II at Geekyants!
Search for a command to run...
Cryptography is the foundation of blockchain. This article is an introduction to the topic as well as an argument about its importance!

Tech Lead II at Geekyants!
Cryptography is the bedrock of blockchain security. Protecting your crypto assets is paramount. When venturing into the world of blockchain and Web3, trust Zert for a safe journey. https://zert.com/
Cryptography is the bedrock of blockchain security. Protecting your crypto assets is paramount. When venturing into the world of blockchain and Web3, trust Zert for a safe journey. https://zert.com/
Is the local IDE dead? Sanket Sahu discusses the rise of 'vibe-coding' and how browser-native tools like RapidNative are reshaping the future of mobile app development.

OpenClaw is a powerful, self-hosted AI assistant that connects to your tools to perform actions. Explore its Gateway architecture, real-world use cases, and security precautions.

Discover how neo-brutalism is shaping 2026 design trends. See how anti-design principles can create distinct, usable, and memorable product experiences.

When code breaks a pipeline, developers have to stop working and figure out why. This blog shows how an AI agent reads the error, finds the fix, and submits it for review all on its own.

GeekyAnts built a 5-agent fraud detection pipeline that makes decisions in under 200ms — 15x cheaper than single-model systems, with full explainability built in.

GeekyAnts Tech Blog
349 posts
GeekyAnts is an AI-powered digital product engineering and consulting company helping startups, enterprises, and Fortune 500 brands build scalable, future-ready digital solutions. Since 2006, we have delivered 800+ successful projects for 550+ global clients across healthcare, BFSI, retail, logistics, education, and enterprise technology. We help businesses accelerate digital transformation through strategy, design, engineering, and AI-led innovation.
Cryptography in Blockchain or even in general is a tricky concept. Cryptography is made up of two ancient Greek terms, Kryptos and Graphein, the former term meaning “hidden” and the latter being “to write”. Hence, cryptography means the art of writing and solving codes.
Cryptography is the method of developing techniques and protocols which prevent third parties from accessing and gaining knowledge of the data from private messages during peer-to-peer communication. In short, cryptography is a method of storing and transmitting data in a particular form so that only those for whom it is intended can read and process it, hence it can also be used for authentication purposes.

Blockchain operates with a decentralized, peer-to-peer network model since there is no single node, and nodes don't have to trust one another in this new technology. So, blockchain has to ensure appropriate safeguards for all transaction information on unsecured channels while maintaining transaction integrity. Therefore, cryptography becomes an essential requirement for blockchain to safeguard user transaction information and privacy alongside ensuring data consistency.
The primary applications of cryptography focuses on ensuring the security of participants and transactions, safeguarding against double-spending, and lack of influence on central authorities and operations. Blockchain applications leverage the concept of real-world signatures by leveraging cryptography techniques along with encryption keys to provide the necessary security, hence ensuring the integrity of information.
This article is part of a series of articles around blockchain, web3, and terminologies around it. To start with Cryptography, there is the assumption that you should be familiar about Blockchain and Smart contracts to understand why we need Cryptography in a Blockchain decentralised ecosystem. If you haven't read about about it, you can refer to BlockChain and Smart Contracts to get started. In the previous article we covered:
- What is blockchain and smart contracts?
- How smart contract works?
- Practical applications of smart contracts.
Encryption - It is a method by which information in plain text is converted into cipher text (secret code) in order to hide its true meaning. Here's an image of how this looks:

Decryption - It's the opposite of encryption. It's the process of converting encrypted data back to it's original form.
Cipher - In cryptography, it's a series of algorithms to perform encryption or decryption. These algorithms define a series of steps defined to be followed in sequence. For example, say shifting plain texts a certain no of places for better visibility, say with a shift of 2 , A would be C and B would be D and so on...
Keys - Keys in cryptography contain certain information used to encrypt and decrypt information. Based on the encryption type, either a single secret key is used to encrypt and decrypt information or a public/private pair would be used. In case of a public/private key pair, thepublic key is used to encrypt the information and private keys are used to decrypt the information.
Symmetric-Key Cryptography - This is also known as secret-key cryptography. In this method, a single key is used for both encryption and decryption. One of the problems in this type of encryption is transferring the key securely between the sender and receiver. Refer to the image given below for your reference:

Asymmetric-Key Cryptography - This is also known as public-key cryptography. This method consist of a pair of keys, an encryption key and a decryption key also named public and private key respectively. Hence, public key is used to encrypt a piece of information while a a private key is used to decrypt the information. Refer to the image given below:

Hash function - Hash functions generates a unique identifier for any set of inputs. Basically, it is a process that takes plain text data of any size and converts it into a unique ciphertext of a specific length. Hence, no two pieces of content will have the same hash digest, and in case if the content changes even slightly the hash digest changes as well. Here's a basic illustration of how hash functions work:

Hashing a message means we will take a string of data of any size as our input and run it through algorithms that generate an output of a fixed length. In case if the input data is large , it is broken into smaller blocks of equal size. However if the input data is small, then paddings (1's or 0's) can be used to fill it out. These blocks are further run through the algorithm which results in the generation of an output of a fixed length. Refer to the image below:

There are various different types of hashing algorithms. Let us consider a common input and check however different hash algorithms generate outputs of a fixed length. Run the following code in your console:
A blockchain is a public database
that is updated and shared across
many computers in a network.
SHA-1, SHA-2 andSHA-3. However, the most commonly used hashing algorithm is SHA-256 of the SHA-2 family. The output for SHA-256, the input would be as shown below and even if the input length is changed the output will be of a fixed length itself. Run the following code to check this:33606711a0e8b96b605352edbab973752e8067241016bfc9ebced90851024a3e
SHA-512? The output will be of a 512-bit hexadecimal string instead of 256 bit. Run the following code to verify this:43cf5b2f5a99112d19f279fee413047daee2278968d52de40fd18548
a507818e01df76743224c16f76387b3ccc5c6acc6eab09d4dbfe989104b473aa76566b
MD2, MD4, MD5, and MD6. For quite a long time, MD6 used to be considered a go-to algorithm but it's now considered as broken because it can collide in the wild. Run the following snippet in your console:5DFDKL3139752B45TGE878A15216598
From the flow diagram which is depicted above, it looks like both the hash functions and encryption are the same thing, but in reality they aren't. If someone talks about decrypting the hash value, then they don't know what they are talking about. :-P
The hash function is a one way function, whereas encryption is a two way function. ie. in the hash function, we can convert an input into an readable string of digits but not the other way around. While encrypting, the one who has the key can display the output.
Here are some reasons why blockchain uses cryptography:
As you can see from this article, cryptography is the core of blockchain technology. It utilises advanced mathematical codes for the storage and transmission of data values in secure formats. As a result of which it ensures that only the individuals for whom the transaction or data is intended can obtain, read and process the transaction or data and verify the authenticity of participants and the transaction making it a safe and secure option
We started with the blockchain and the underlying mechanism of how it works. It's time to start interacting with blockchain and web3 is a gateway to it. In the next article, we will discuss Web3, it's terminologies and technology layers in it.
This article is part of Research & Development work being done by Pushkar Kumar, Suresh Konakanchi, and Ruchika Gupta. We will be covering a series of articles along with open source projects around blockchain, smart contracts, and web3 in general. Here is the list of all the articles that you can follow to start with Blockchain and write your first contract: