Cryptography - Security basics for blockchain users

in #beyondbitcoin7 years ago

Explain blockchain security so that a 10 year old could understand it. No math. That is the goal of this article. I actually think it's everyone should be able to grasp the basis.

Cryptography

The blockchain is built with the idea of decentralization in mind. (Check this article for a good introduction) This means there is no central instance to guarantee safety. So how is safety guaranteed if there is no-one you can trust? Say hello to cryptography.

Cryptography is a method of handling data in a particular form so that only the intended recipient can read and process it. Although this is a complex matter in detail the basics can be easily understood. I'm amazed how little blockchain users, even experienced ones, and even some developers, have no basic understanding how this works.

Symmetric cryptography

In cryptography a lot of examples use Bob and Alice so I will as well. (There’s actuatlly a Wikipedia article about them: https://en.wikipedia.org/wiki/Alice_and_Bob) Now let’s start simple. Bob wants to send a box to Alice and only Alice should be able to open it. Bob uses a box with a padlock. As all padlocks this lock has a key that can lock and unlock the box. If Bob wants to protect something, he puts it in the box and locks it. Obviously, only he or someone else with a copy of his key can open the box.
That’s how simple symmetric cryptography is. You have one key. You use it to lock or encrypt the data and you use it to unlock or decrypt the data.
This won’t work for the blockchain though. I would mean Bob has give his key to Alice. Maybe he doesn't trust her with his key. What if she gives the key to the mailman? Or maybe he trusts her today but changes his mind tomorrow. He could only prevent this issue by using new locks and he would end up with a nightmare of locks and keys to handle.

Asymmetric cryptography

In an asymmetric system Bob and Alice have separate padlocks. Bob asks Alice to share with him her opened lock. Alice has no problem doing this. After all, what can Bob do with this opened lock, he can only close it. She is the only one who has the key, so only she can open it. So in fact Alice can (and does) share here lock with everybody. In cryptography the lock is called the public key and the key is called the private key. When Bob wants to send something he uses the padlock he received previously to protect the contents. When he now sends the closed box only Alice can open the box, no-one else.
The big advantage in an asymmetric key system is that Alice and Bob never need to share a copy of their keys. None of the concerns with symmetric cryptography apply here.
This example has one shortcoming for the blockchain. Alice doesn’t know for sure Bob send her the box. She shared her locks so it could have come from anyone. If Bob were to sign the content Alice can be sure it is Bob’s message. So let’s introduce another example.

Digital signature

A normal padlock has two states. Now imagine a special lock, one with a slider switch. The lock has three positions and two keys. In two positions (A and C) the lock is closed. Only in position B the lock is open.

One key, let’s call this the private key, can move the lock from left to right. The other one, which we call the public key, can move the lock from right to left. If you carefully look at the image you can see how the lock can be unlocked. Now imagine the same as before: Bob wants to send his box to Alice. Alice again freely distributed her public key to anyone who might want to use it. Bob takes closes the box using the public key from right to left and puts the lock in position A. The box passes the not so trustworthy mailman. He can’t open the box since he can’t possible have a key to move the lock to the right. Alice is the only one with the private key that can move the lock back to the right, to the open position B. We now have the same situation as with the previous example. The shortcoming of that example was that Alice and Bob have no certainty that they received a message from the other person. With this lock this is possible.

Suppose Alice wants to send something to Bob. She puts it in a box and closes that box with her private key, moving the lock to the C position. When Bob receives the box the mail man says it is from Alice. But who trusts the mail man in cryptography, no-one right? Bob uses Alice’s public key he has previously obtained and the lock moves from C to B, the lock opens. Since Alice is the only one who could have put the lock in position C, Alice is the only one with a key that can move the lock to that position, Bob is now sure the box came from Alice. This is an analogy for what is called a digital signature.

Combine both techniques allows to send a box that can only be opened by the correct recipient and that recipient can be sure it was sent by a particular sender. That is the very basic security the blockchain uses.

I wrote this article because I'm exploring Gridcoin and started to receive some questions. I have some background in cryptography and decided to write this short explanation. Gridcoin is a lovely initiative and if you would like to get involved: @dutch made the total and utter noobie guide to successfully mining the cryptocurrency gridcoin on Steemit a while ago. I also shared my first experiences here on Steemit.

Sort:  

Very well explained, thank you!

Good explanation, again a little closer to fully understanding cryptocurrencies,Thx.

This post has received a 1.56 % upvote from @drotto thanks to: @banjo.

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by Jef Patat from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews/crimsonclad, and netuoso. The goal is to help Steemit grow by supporting Minnows and creating a social network. Please find us in the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

Coin Marketplace

STEEM 0.25
TRX 0.20
JST 0.038
BTC 94956.90
ETH 3542.14
USDT 1.00
SBD 3.80