Cryptography in Blockchain
Cryptography in Blockchain
Types of Cryptography
Cryptography can be broadly categorised into symmetric and asymmetric
cryptography.
1. Symmetric Cryptography:
In this type, the same key is used for both encryption and decryption. It's like
having a single key to lock and unlock a door. For example, the Advanced
Encryption Standard (AES) algorithm uses symmetric cryptography. When you
send a message encrypted with AES to someone, you use the same key to
encrypt and the recipient uses the same key to decrypt.
XYZ……… XYZ………
……………… ………………
……………… ………………
…………….. ……………..
1|Page
2. Asymmetric Cryptography:
XYZ……… XYZ………
……………… ………………
……………… ………………
…………….. ……………..
Alt text: Asymmetric algorithm that uses the different cryptographic keys
Digital Signatures:
Digital signatures in cryptography are like electronic fingerprints. They verify two
things:
Participants use their private keys to create digital signatures for transactions or
messages. Others can use the sender's public key to verify the digital signature
and confirm the sender's identity.
2|Page
Hash Function
Cryptographic hash functions are used to generate a fixed-size string of
characters (hash) from any input data. In blockchain, each block contains the
hash of the previous block, creating a chain. This ensures the integrity of the
entire transaction history.
Each block in a blockchain consists of the following:
● data/details of the transaction
● its hash
● the previous block’s hash
The first block is called the genesis block, and it is the only block that does not
contain the previous block's hash.
3|Page
BlockChain Block Hashing
SHA-256
49FCA16A2
271B340 66
DAA46492
C226C4...
Let us now see the steps how hashing is applied on each block
4|Page
4. Chaining Blocks Together:
● Each block's header also includes the hash of the previous block in the
chain.
ef779713d3a75526946a3bcf00daec9 625da44e4eaf58d61cf048d168aa6f5e4
fc9c9c4d51ddc7cc5df888f74dd434d1 92dea166d8bb54ec06c30de07db57e1
5|Page