Contents
Cryptography is the method of securing data from unauthorised access. When we say Cryptography, we are looking for the following.
Before going to blockchain in cryptography, let's first understand cryptography.
The information cannot be understood by anyone for whom it was unintended. Except for the sender and receiver, no one can read the message.
Integrity is used to ensure that nobody in between the sender and receiver can change some parts of the message.
The sender can't deny that he has not sent that message at a later stage.
To verify the identity of who created the message.
Encryption: It is a process of converting plaintext to ciphertext.
Decryption: It is a process of converting ciphertext to plaintext.
Cipher: It is the unreadable output of an encryption algorithm.
Key: A key is a piece of information. Usually, a string of numbers or letters, which, when processed through a cryptographic algorithm, can encode or decode cryptographic data.
It uses the same key to encrypt and decrypt information.
In asymmetric cryptography, we have a pair of public and private keys. The public key is used to encrypt the data, while the private key decrypts the data.
The public key is known to everybody, while the private key is secret.
Whoever wants to send a message to any receiver uses the receiver's public key to encrypt the data, and the receiver uses its private key to decrypt the data.
Anyone can send a message to B by using B's public, But only B can read that message using its private key.
Suppose the sender uses his private key and encrypts the message if the receiver can decrypt the message with A's public key. That means the information came from A. This is called Digital Signature.
But the problem is that everybody has A's public and can decrypt the message. This breaks confidentiality.
This is a fascinating setup, where A will use his private key to encrypt the data, and then A will use B's Public key to encrypt it again.
On the receiver end, B will first use his private key to decrypt the. This gives confidentiality. Then B will use A's public key to once again decrypt the data, and this is the way we achieve authentication.
Case Study MD5 is broken.
Earlier, MD5 was considered a cryptographic hash function, but in 2008, we found that we could easily find collisions. We should not use MD5, as it is less secure.
Read more
Blockchains make use of two types of cryptographic algorithms,
The public key, visible globally, is used as the person's address, while the private key is a secret used to access or perform any actions on that address data.
Hash is used in the chain part of a blockchain. The hash value of that block is used as an address of that block. Any alteration in the block data can lead to inconsistency and break the blockchain, making it invalid.