by Peter Lipovyanov, Investment Banker & Venture Investor
Learn about cryptography in this article by Peter Lipovyanov, an experienced investment banker and venture investor currently focusing on blockchain projects and crypto-assets.A firm believer in the potential of blockchain technology to change the world for the better by facilitating financial inclusion across the globe and improving the efficiency of financial markets and other sectors of the economy, he has been involved in several promising blockchain projects building decentralized applications.
Blockchain is a technology that pretty much took the world by storm in 2017, and it shows no signs of slowing down. Bitcoin, blockchain, and cryptocurrency are words that almost everybody knows these days. These words have entered peoples' minds through mainstream media, which has finally paid some attention to this exciting new technology.
In this article, you will learn all about the art of cryptography and how it has evolved with time. You will get to learn how cryptography affects various aspects of the internet.
Introduction to cryptography
The crypto part of cryptocurrencies is a well-publicized term that you may have probably heard plenty of times over the last year or so. This sounds a bit mysterious or a bit cryptic, doesn't it? Many of you have probably heard the word cryptography, but how many actually know what it involves?
Cryptography is the science of secure communication. It is useful in order to secure private information from being accessed by unauthorised third parties who can potentially act in bad faith.
The process involves two main steps:
The first step is encryption, which consists of scrambling the information so that only the intended recipient can access it.
The next step is decryption, which is unscrambling the encrypted information in order to access and use it.
The encryption and decryption process usually involves mathematical techniques of varying complexity. The value added by cryptography has been recognised a long time ago, and such techniques have been used for millennia.
Uses of cryptography in early times
Julius Caesar is known to have used encrypted messages to communicate with his generals. His technique was simple by today's standards; he used letters that were three positions away in the alphabet after the intended letter. For example, the letters ABC would be represented by DEF. In fact, this encryption method is widely known as the Caeser cipher.
Another famous example of the use of cryptography, which has high historical significance, was the Enigma machine invented by the German engineer Arthur Scherbius at the end of World War I.
It was commercialized in the early 1920s and the German army adopted it soon after, in order to secure its military communications. The Enigma machine has nearly 159 Quintilian different combinations of characters and numbers (more precisely 158,962,555,217,826,360,000). The Enigma cipher was considered unbreakable at the time and gave an edge to the German army during World War II. However, a team led by the brilliant English mathematician and early computer science pioneer, Alan Turing, managed to crack the Enigma code, which helped the
Allies win the war. These events were recreated in the 2014 film, The Imitation Game.
Types of cryptography
Now, we'll introduce some important concepts that will help you understand cryptography's role in the world of blockchain.
Cryptographic ciphers are encrypted and decrypted with keys. These keys are basically secret pieces of information or parameters, which typically look like strings of characters. Think about something such as a password or passphrase that locks and unlocks access to an encrypted message. These are actually keys to the cryptographic algorithms and help convert ordinary information (called plain text) into unintelligible text (called ciphertext) and vice versa. This is shown in the following diagram:
There are two main types of cryptography:
Symmetric (also known as secret key cryptography): This is a type of cryptography where the same key is used for both encryption and decryption. This can be seen in the following diagram:
Asymmetric (also known as public key cryptography): This is a type of cryptography, where the key used for encryption is different from the key used for decryption. This can be seen in the following diagram:
The second type of cryptography, with pairs of public and private keys, is used to provide security and privacy in Bitcoin and other cryptocurrencies. Actually, the Bitcoin blockchain is the largest civilian deployment of public key encryption technology in the world. Only the US Department of Defense makes a larger use of such technology, which says a lot about its merits.
Cryptographic techniques used in Bitcoin
Several cryptographic techniques are used to secure the Bitcoin blockchain, including:
Public and private keys
Hash functions
Digital signatures
Public and private keys
Any person who has ever used a cryptocurrency to make a transaction should be familiar with how keys work. Each user has a pair of keys (a public and a private one), which enable transactions on the network. You can see some examples of public and private key pairs in Bitcoin in the following screenshot:
The public key is used by the sender to encrypt information regarding the transaction, which then can be decrypted only by the receiver with his or her corresponding private key. The public address, which acts as an account, can only receive funds and is derived from the public key and can be shared openly. The private key must be stored securely and never disclosed as it, and only it gives access to the user's funds on the blockchain.
If the private key is lost, access to the funds is lost permanently. There is no such thing as a password reset function on the blockchain. Users need to take responsibility for storing and backing up their private keys properly because there is no central authority on the network that can reverse misplaced transactions or restore private keys. You need to be sure that you understand the implications of any loss of private keys and take all the possible measures to avoid it.
You should treat the private keys for your Bitcoin or another cryptoasset with the same care you treat any physical cash, gold, or diamonds you may have. The difference here is that you can back up your private key, as it is a string of characters that can be copied. Therefore, you can print it on paper, save it on a USB memory stick, or use special devices called hardware wallets, such as Ledger or Trezor, that can securely store your private key.
Next, we'll explore another major application of cryptography in Bitcoin—cryptographic hash functions.
Hash functions
All nodes store identical copies of the blockchain database, and that's an issue that undoubtedly results in a lot of data storage and redundancy. However, it is the price we have to pay in order to obtain a truly decentralized peer-to-peer system without any middlemen.
Moreover, datasets can be different in size, some blocks may have 200 transactions, other blocks may have 500 transactions, and others may have 1,000 transactions. All these transactions also typically vary in the size of the information they contain in terms of kilobytes. The only capacity limit in the Bitcoin blockchain protocol is on the size of each block, which has been 1 megabyte since 2010. It was recently amended to effectively 1.4 MB with the latest upgrade of the Bitcoin software. But again, block sizes can vary up to that limit. You can check for yourselves what blocks look like at blockchain.info or other online block explorers. In the following screenshot, you can see some example blocks:
Hence, a blockchain can benefit from some standardization and rationalization of the data it stores.
A mechanism that allows us to address that is cryptographic hash function, which is an efficient way to secure data integrity and reduce file size. Hash functions are used to convert input data of any length into a compressed unique fixed-length string of characters (also known as a bit string). This output data serves as a unique reference code or digital fingerprint to verify the authenticity of some underlying dataset without the need to actually check the entire dataset.
In practice, this hash function is a mathematical algorithm that maps data of arbitrary size to a bit string of a fixed size (also known as a hash). It is designed to be a one-way function, meaning a function which cannot be inverted and recalculated backward to get to the input data. This can be seen in the following diagram:
The only way to recreate the input data, if one has the output only, is to attempt a brute-force search of all possible inputs to see if they produce a match. A brute-force search is basically systematically trying all possible combinations to find the solution.Hash functions are heavily used in the Proof-of-Work blockchain consensus algorithm.
Digital signatures
Another important cryptographic technique used in Bitcoin is digital signatures. They are used for authentication of the origin of transactions on the blockchain. They enable the receiver to verify that the transaction received was originally sent by the sender using his or her private key. This process again includes mathematical calculations. Surprise, surprise!
Basically, the digital signature is generated out of the sender's private key being processed through a digital signature algorithm. The resulting code output is then attached to the signed message and acts as a signature. It designates the sender of the message. Each transaction will have a different digital signature, which is generated through the digital signature algorithm to increase security. It is impossible to generate a valid signature for a party without knowing that party's private key.
Note that we use the words transaction and message interchangeably because transactions on the blockchain are basically messages broadcasted through the network. When you send cryptocurrency to another person, you are basically sending them a message.
Furthermore, digitally signed transaction messages are unforgeable, meaning they cannot be intercepted and modified or reproduced while in transit.
Digital signatures are also non-reusable and they cannot be separated from a transaction message and used for a different message given that the algorithm creates a new signature for each transaction.
To conclude the topic, let's put these cryptographic solutions into the words of the great Satoshi himself:
"We define an electronic coin as a chain of digital signatures. Each owner transfers the coin to the next by digitally signing a hash of the previous transaction and the public key of the next owner and adding these to the end of the coin. A payee can verify the signatures to verify the chain of ownership."
If you found this article interesting, you can explore Blockchain for Business 2019 as your one-stop guide to blockchain technology and its business applications. It is a comprehensive guide that enables you to bring in various blockchain functionalities to extend your existing business models and make correct fully-informed decisions.
Comentários