The Wayback Machine - https://web.archive.org/web/20241125185304/https://www.geeksforgeeks.org/blockchain-public-key-cryptography/
Open In App

Blockchain – Public Key Cryptography

Last Updated : 03 May, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Blockchain technology is one of the greatest innovations of the 21st century. In this article, we will focus on the concept of cryptography i.e. public-key cryptography or Asymmetric key cryptography.

Introduction To Public-Key Cryptography

Most of the time blockchain uses public-key cryptography, also known as asymmetric-key cryptography. Public key cryptography uses both public key and private key in order to encrypt and decrypt data. The public key can be distributed commonly but the private key can not be shared with anyone. It is commonly used for two users or two servers in a secure way.  

Public Key Cryptography

 

Public Key: Public keys are designed to be public. They can be freely given to everyone or posted on the internet. By using the public key, one can encrypt the plain text message into the cipher text. It is also used to verify the sender authentication. In simple words, one can say that a public key is used for closing the lock.

Private Key: The private key is totally opposite of the public key. The private key is always kept secret and never shared. Using this key we decrypt cipher text messages into plain text. In simple words, one can say that the private key is used for opening the lock.

Why Do We Need Public-Key Cryptography?

  • In symmetric-key cryptography, a single key is used to encrypt and decrypt the message. Here, the possibility of data loss or unauthorized access to data is high. To overcome the unauthorized access of data and data sent securely without any loss, we use public-key cryptography.
  • Public-key cryptography is more secure than symmetric-key cryptography because the public key uses two keys to encrypt and decrypt the data
  • Public-key cryptography allows users to hide the data that they want to send. The sender encrypts the data and the receiver decrypts the data. The encrypted message is not understood by unauthorized users.             

Working On Public-Key Cryptography

Suppose, the sender wants to send some important message to the receiver. 

  • The sender first creates a message in the form of plain text which is in a readable format.
  • The sender knows the public key of the receiver but doesn’t know the private key of the receiver because the receiver keeps secret his private key. With the help of the public key of the receiver and the private key of the sender, the sender generates the encrypted message i.e. called cipher text. Cipher text is in an unreadable format. In this step, plain text converts into cipher text.
  • Now, cipher text reaches the receiver end. The receiver knows its own private key, and with the help of the private key receiver converts the cipher text into readable format i.e. plain text.

The below example shows the working of public-key cryptography.

Public Key Cryptography

 

Let us try to under the working of public-key cryptography with an example. Suppose Sachin is the sender who wants to send a message to Anurag. Here Anurag is the receiver. 

  • Sachin uses Anurag’s public key to encrypt the message and Anurag uses his own private key to decrypt the message.
  • First Sachin creates plain text. Sachin has access to Anurag’s private key and cipher text. Using Anurag’s public key and his own public key,
  • Sachin will generate an encrypted message i.e. cipher text which is in an unreadable format. After applying the encryption process plain text converts into cipher text.  
  • Now, Anurag receives a cipher text. First Anurag will decrypt the cipher text message into a readable format. For decrypting Anurag will use the private key. Now cipher text converts into plain text and is readable by the receiver.  Because Sachin keeps his private key, Anurag knows that this message couldn’t have come from anyone else. This is also called a digital signature. 

Benefits of Public-key Cryptography

  • Authentication: It ensures to the receiver that the data received has been sent by the only verified sender.
  • Data integrity: It ensures that the information and program are changed only in a specific and authorized manner.
  • Data confidentiality: It ensures that private message is not made available to an unauthorized user. It is referred to as privacy or secrecy.
  • Non-repudiation: It is an assurance that the original creator of the data cannot deny the transmission of the said data to a third party.
  • Key management: Public-key cryptography allows for secure key management, as the private keys are never transmitted or shared. This eliminates the need for a secure channel to transmit the private key, as is required in symmetric key cryptography.
  • Digital signatures: Public-key cryptography allows for the creation of digital signatures, which provide non-repudiation and can be used to verify the authenticity and integrity of data.
  • Key exchange: Public-key cryptography enables secure key exchange between two parties, without the need for a pre-shared secret key. This allows for secure communication even if the parties have never communicated before.
  • Secure communication: Public-key cryptography enables secure communication over an insecure channel, such as the internet, by encrypting the data with the public key of the recipient, which can only be decrypted by the recipient’s private key.
  • Versatility: Public-key cryptography can be used for a variety of purposes, such as secure communication, digital signatures, and authentication, making it a versatile tool for securing data and communications.

Limitation of Public-Key Cryptography

  • One can encrypt and decrypt the fixed size of messages or data. If there is an attempt to encrypt or decrypt a large size of the message then the algorithm demands high computational power.
  • The main disadvantage of this algorithm is that if the receiver losses its private key then data/message will be lost forever.
  • If someone has access private key then all data will be in the wrong hand.
  • There are many secret-key which is faster than public-key cryptography.
  • Key distribution: The process of securely distributing public keys to all authorized parties can be difficult and time-consuming, especially in large networks.
  • Performance: Public-key cryptography is generally slower than symmetric-key cryptography due to its more complex algorithms, making it less suitable for applications that require fast processing speeds.
  • Security assumptions: Public-key cryptography relies on mathematical assumptions about the difficulty of certain problems, such as factoring large numbers, which may not hold true in the future. As a result, public-key cryptography is vulnerable to future advancements in computing power and algorithmic breakthroughs.
  • Susceptibility to man-in-the-middle attacks: Public-key cryptography is vulnerable to man-in-the-middle attacks where an attacker intercepts and alters the public key before it reaches the intended recipient. This can result in the attacker being able to decrypt the message or impersonate the sender.
  • Complexity: Public-key cryptography can be more complex to understand and implement than symmetric-key cryptography, requiring specialized knowledge and expertise.


Previous Article
Next Article

Similar Reads

Blockchain - Private Key Cryptography
Private key encryption is an encryption method that allows users to send and receive information securely over a network. As part of the blockchain, private key cryptography is used to ensure the security of transactions and ownership of digital assets. What is Private-Key Cryptography?Private key cryptography also known as symmetric-key cryptograp
8 min read
Cryptography in Blockchain
One of the important questions that always comes to our mind is How blockchain is secure? and What makes blockchain secure? Blockchain security is built on two concepts Cryptography and Hashing. This article focuses on discussing these two important concepts in detail. Cryptography in BlockchainCryptography is a method of securing data from unautho
8 min read
Blockchain - Elliptic Curve Cryptography
Cryptography is the study of techniques for secure communication in the presence of adversarial behavior. Encryption uses an algorithm to encrypt data and a secret key to decrypt it. There are 2 types of encryption: Symmetric-key Encryption (secret key encryption): Symmetric-key algorithms are cryptographic algorithms that employ the same cryptogra
13 min read
Difference between Public and Private blockchain
1. What is Public Blockchain ? Public blockchains are open networks that allow anyone to participate in the network i.e. public blockchain is permissionless. In this type of blockchain anyone can join the network and read, write, or participate within the blockchain. A public blockchain is decentralized and does not have a single entity which contr
5 min read
Public Blockchain
Public blockchains are decentralized networks that allow anyone to participate, read, and write data without needing permission from a central authority. They operate on an open-source framework, ensuring transparency and security through cryptographic principles. Transactions on public blockchains are validated by a consensus mechanism allowing fo
7 min read
How to Create a Public/Private Key Pair?
Public/private key pairs are the cryptographic tool that allows you to encrypt and decrypt data. A public key can be shared with anyone without worry, but a private key should never be given out without protection.In Private key encryption, the same key (secret key) is used for encryption and decryption. In this key is symmetric because the only ke
2 min read
Blockchain Key Areas
Blockchain is the backbone of technology Digital CryptoCurrency BitCoin. The blockchain is a distributed database of records of all transactions or digital events that have been executed and shared among participating parties. Each transaction is verified by the majority of participants of the system. It contains every single record of each transac
2 min read
What is Blockchain Private Key QR Code and How to use it?
Blockchain is a trending technology and in its ever-evolving ecosystem, exists many key components that ease up the process of management of digital assets. Blockchain Private Key QR is one of the components for conveniently storing private keys and faster access to funds. In this article, we'll be exploring the blockchain private key, the private
9 min read
Flutter and Blockchain - Hello World Dapp
This tutorial will take you through the process of building your first mobile dapp - Hello World Dapp! This tutorial is meant for those with a basic knowledge of Ethereum and smart contracts, who have some knowledge of the Flutter framework but are new to mobile dapps. In this tutorial we will be covering: Setting up the development environmentCrea
9 min read
Integration of Artificial Intelligence and BlockChain
Artificial Intelligence and Blockchain are proving to be quite a powerful combination, improving virtually every industry in which they're implemented. These technologies can be combined to upgrade everything from food supply chain logistics and healthcare record sharing to media royalties and financial security. The integration of AI and Blockchai
8 min read
How to use GANACHE Truffle Suite to Deploy a Smart Contract in Solidity (Blockchain)?
There are various processes involved in deploying a smart contract using Ganache and Truffle Suite: 1. Install Ganache first. Ganache is a personal blockchain for Ethereum development. You must first download and install it. It is available for download from https://www.trufflesuite.com/ganache, the official website. 2. Install Truffle Suite: The n
4 min read
Introduction to Blockchain technology | Set 2
Blockchain technology has been garnering great hype recently. It gained popularity after the introduction of Bitcoin in 2009 by the person or group of people by the pseudonym Satoshi Nakamoto. Many people confuse and believe blockchain to be bitcoin. But, bitcoin is one application of the blockchain technology. There are many other applications and
5 min read
What is Blockchain Wallet?
A blockchain wallet is a software that enables sending and receiving cryptocurrencies such as Bitcoin, Ethereum, etc. It stores the record of transactions and also public and private keys which are used to perform transactions. A public key is similar to an account number. If A wants to send some money to B using Bitcoin when A sends the public key
10 min read
What is Consortium Blockchain?
A consortium blockchain is a group of multiple financial institutions where each financial institution has its private blockchain. In this blockchain, a pre-selected set of nodes are allowed to control the consensus process. What is Consortium Blockchain?Consortium blockchains are managed and run by a number of organizations or entities. As a permi
9 min read
Blockchain - Proof of Work (PoW)
Proof of Work consensus is the mechanism of choice for the majority of cryptocurrencies currently in circulation. The algorithm is used to verify the transaction and create a new block in the blockchain. The idea for Proof of Work(PoW) was first published in 1993 by Cynthia Dwork and Moni Naor and was later applied by Satoshi Nakamoto in the Bitcoi
6 min read
Blockchain and Data Privacy
Blockchain has been defined as a digital, decentralized ledger that keeps a record of all transactions that take place across a peer-to-peer network. It enables the secure transfer of assets without an intermediary. It also provides a record of transactions that is fully transparent and displayed in real-time for benefit of participants. Blockchain
11 min read
Consensus Algorithms in Blockchain
Prerequisites: Introduction to Blockchain technology | Set 1, Set 2 We know that Blockchain is a distributed decentralized network that provides immutability, privacy, security, and transparency. There is no central authority present to validate and verify the transactions, yet every transaction in the Blockchain is considered to be completely secu
5 min read
What Are Cryptoasssets in Blockchain
So as you are aware of Blockchain technology and have of the basic idea of it, in this article we will be talking about the cryptocurrency part of the blockchain, more specifically about the crypto-assets. As we know, an asset is something that holds value, similarly, a crypto-asset is an asset that is based on cryptography. Mostly it is a virtual
3 min read
Basics of the Blockchain and its various applications
The BlockChain, to begin with is undeniably one of the most ingenious inventions of mankind. Considering it to be the brainchild the pseudonym, Satoshi Nakamoto, the technology has evolved into something unimaginably great. However, the most commonly asked always arises every single time - What is this Blockchain? A BlockChain is defined as a peer
5 min read
Proof of Stake (PoS) in Blockchain
Proof of Stake (PoS) is a type of algorithm which aims to achieve distributed consensus in a Blockchain. This way to achieve consensus was first suggested by Quantum Mechanic here and later Sunny King and his peer wrote a paper on it. This led to Proof-of-Stake (PoS) based Peercoin. A stake is value/money we bet on a certain outcome. The process is
5 min read
How Block Hashes Work in Blockchain?
Blockchain is the backbone technology of the digital cryptocurrency Bitcoin. The blockchain is a distributed database of records of all transactions or digital events that have been executed and shared among participating parties. Each transaction is verified by the majority of participants of the system. It contains every single record of each tra
7 min read
Features of Blockchain
Here In this article, we will discuss the features of blockchain technology and how they make it a revolutionary and highly desirable platform for various applications. A blockchain is a chain of blocks that contains information. Most people think that Blockchain is Bitcoin and vice-versa. But it’s not the case. In fact, Bitcoin is a digital curren
7 min read
How does BlockChain support Crowdfunding ?
The Crowdfunding platform in block-chain makes different possibilities for the startups by raising the funds to create their own digital currency and it is peer-to-peer fund raising model some of the famous crowdfunding cryptocurrencies are coinspace, swarm, judobaby etc. Crowdfunding has offers for creators and other consumers. Anyone can particip
2 min read
Demur-rage currencies in Blockchain
Currency is one such core concept in blockchain technology that can extended and re-understood. Currency which is usually referred as digital token it facilitates quantified transfer mechanism. This idea is known as Demur-rage currency. Demur-rage means "cost of carrying"- that is the cost to carry an asset. The Demur-rage originated from freight a
2 min read
Blockchain Gaming : Part 1 (Introduction)
Blockchain Gaming. It’s a world of it’s own. It’s ‘Ready Player One’ incorporated into gaming. Before reading this article, it is recommended to read: Introduction to Blockchain to get well versed with the concept of blockchain. Part-1: Transparency, Proven Rarity and True Ownership Transparency: When games use third party distribution platforms li
4 min read
Blockchain Hash Function
A hash function is a mathematical function that takes an input string of any length and converts it to a fixed-length output string. The fixed-length output is known as the hash value. To be cryptographically secure and useful, a hash function should have the following properties: Collision resistant: Give two messages m1 and m2, it is difficult to
5 min read
Guidelines for learning Blockchain
As a beginner, while starting learning something new everyone is having a question in mind, "How to get started?". When I started learning Blockchain I was in the same situation. So I want to share my journey of BLOCKCHAIN with you, by this, every technical worm who is interested in learning new technologies will get an idea about this trending tec
6 min read
Blockchain and Block Header
Blockchain is a database, or broadly distributed database, used mainly for concurrent transactions and one of the most popular implementations of blockchain is Bitcoin. Blockchain has several blocks, also called nodes, and all the blocks are managed with the help of the block header. Constituents of Block Header are : TimestampVersionMerkle RootDif
3 min read
Top 10 Programming Languages for Blockchain Development
Do you ever wonder about the sudden emergence and popularity of Blockchain? What is it? Well, Blockchain is literally a chain of blocks as the name suggests! It’s just that the “blocks” in this context are digital information that is connected using cryptography. Each of these blocks contains a cryptographic hash function linking to the previous bl
7 min read
How Blockchain Technology Can Accelerate the Potential of IoT?
Yes, the blockchain has enormous potential to accelerate the Iot functioning efficiently. Since, security is a major concern with IoT that has hindered its large-scale deployment. IoT devices often suffer with security vulnerabilities that make them an easy target for Distributed Denial of Service (DDoS) attacks.So these are some concern of blockch
3 min read
Article Tags :
three90RightbarBannerImg