Unblocking the Blockchain: Public-Key Cryptography
Recap From Previous Article
In the previous article, we explored how symmetric key algorithm or private-key cryptography works. We learned that there are challenges with using the same private key to encrypt and decrypt data. These are summarised below:
- How do we ensure that the private key is exchanged over a secure channel?
- An encrypted message may be stolen and decrypted by anyone who has access to the Private key.
- How do we trust the identify of the other party receiving the message?
- How do we trust that the message is from the sender, since the recipient is also having the same private key?
- The Sender has to keep track of multiple keys when sending multiple messages.
Blockchain uses Public-key cryptography which is an encryption based upon asymmetric key algorithms. Public-key cryptography uses two keys instead of one to encrypt and decrypt data.
To explain further, let's use the same example from the previous article. This time, however, A sends a lock to B instead of the private key. The lock is the public key, and known to all. Whoever wishes to send a message to A uses the lock belonging to A to secure the message. A then uses the private key to unlock the message.
Public-key Cryptography Explained Using Colours
Let us now look at public-key cryptography with the help of colours.
B uses A's public key to encrypt a message before sending to A.
Only A is able to receive this message using his own private key.
And Vice-versa ...
A wishes to send a message to B.
A uses his own private Key to encrypt the message before sending.
B uses A's public key to decrypt the message. This shows that the message originates from A, and nobody else.
Public-key cryptography clearly offers better security compared to using symmetric-key cryptography as described in the previous article.
Two different keys are used for encryption and decryption of messages for communications.
In Blockchain applications, digital signatures based upon public-key cryptography are implemented using mathematic algorithms. A pair of public and private keys are generated. Just like what you saw in the colour examples above, this pair of keys are mathematically related. So only the public key can decrypt what the private key has encrypted and vice versa. The chance that an eavesdropper (or hacker) can derive the private key from a given public key (or vice-versa) is very small.
Another article I have written explains more about mathematical formulas that can be used to implement the public-key cryptography technique used in Bitcoin and Blockchain.
For the rest of us who are not so keen on the explanation of how the public and private Keys are related mathematically, below is a diagram showing how a plaintext has been encrypted and decrypted using public-key cryptography formulae.
As mentioned earlier, digital signatures used in Blockchains are based on public-key cryptography. In Blockchain, users on the nodes need assurance that the records are non-repudiatable to avoid disputes.
We will be talking about the model of digital signature schema in the next article.
- Unblocking the Blockchain: Private-key Cryptography
A fundamental aspect of Blockchain, this article offers a simple explanation of cryptography where Digital Signatures are based upon. You will be introduced to both symmetric and asymmetric key cryptographies.
- Unblocking the Blockchain: Cryptography and Digital Signatures
There are two main cryptographic concepts that form the basis of a Blockchain network. The first is hashing, and the second is digital signatures. A Digital signature proves the identity of a sender with the private key that claims ownership of asset
© 2018 Heng Kiong Yap