Blockchain Cryptography

Shashank M
3 min readFeb 1, 2018

--

Blockchain is definitely a buzzword. More than the buzz, the words behind the white papers of blockchains can make a naive programmer break cold sweats in successive unison. Well at-least thats how I felt.
In this post lets demystify the jargon behind the cryptographic techniques used in the popular blockchains.

The basic building block is the concept of public key cryptography. But before we start, let us understand Keys.

Keys

So what the heck is a Key?
Its nothing but a shred/piece of data which results in a definite output. More plainly put, a key determines how a piece of normal text should be turned to cipher text(Encrypted data). It also determines how to reconvert back the cipher text into normal text.

Initially there was only one key. This key was used for both encryption and decryption of data. It is known as Symmetric cryptography. This is simpler to manage but presents a major security risk. If the key is compromised, then this leads to a data breach.

This led to improvisation and the result is a system which had two keys. Private key and Public Key also known as Asymmetric cryptography. Public keys are used for verification and encryption. The private keys are used for decryption.

Private Key — The key which is known only to you. This should never be made public or known to other users. This is your holy grail and you should guard it with the same passion as you generally would guard your Oreos.

Private Keys

Public Key -The key which you share with others. This is something similar to your phone number or email address. This is the key you share with others.

Public Key

So how are keys generated?

Keys are generated by a keygen. The job of the key-gen or key generator is to constantly spit out keys adhering to a particular algorithm. The common ones include AES , RSA etc. A point to note is that public key generation is always slower than the symmetric key generation since two keys are to be generated(Public and Private).

The other way is to use a Pseudorandom number generator which uses integers to generate keys. PNRG’s use an initial value called the seed to start the process and then generate sequence of number based on the initial seed.
Another way is to use system entropy to generate the keys. PNRG’s which use system entropy generally tend to produce harder to crack sequence of numbers since entropy in a system at any given moment is random in nature. The other method which can be used is to allow the user as the source of seed. This is often done by asking the user to move a mouse across the screen and the coordinates can be taken as a seed.

So how are keys exchanged?

Fundamentally there are two ways:

  1. In- Band Exchange
    In this method, the keys are exchanged via the same medium/channel that the data is sent.
  2. Out-of-Band
    In this method, the keys and the data are exchanged in different channels.

The above methods are generic methods by which keys are exchanged. The most widely known methodology is the Diffie-Hellman Key exchange. This allows keys to be sent over any medium irrespective of whether they are secured or not. One of the common methods is through CA(Certificate Authority). This falls under the ambit of Public Key Infrastructure.

How many types of Keys are there?

  1. Authorization Key
  2. Authentication Key
  3. Signature Key
  4. Key Transport Keys
  5. Ephemeral Key Agreement Key
  6. RNG Key
  7. Static Key Agreement Key
  8. Master Key

If you liked the article show some love on the clap button! 👏
Loved it? Buy me a coffee! ☕
Bitcoin Address: 186LZNFgGCMfa3x2MmyJY5rMVu7aFHxxW5
Ethereum Address: 0x552410434f2E74Ccf13038325Fc55f0DAB8Bb772

--

--