1,073
edits
[checked revision] | [checked revision] |
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
|title= Шифрование в блокчейне | |title= Шифрование в блокчейне | ||
|titlemode= append | |titlemode= append | ||
|keywords= | |keywords= Encryption in the blockchain | ||
|description= | |description= Encryption in the blockchain | ||
}} | }} | ||
<div class="mikio-article-content"> | <div class="mikio-article-content"> | ||
<div class="mikio-tags"> | <div class="mikio-tags"> | ||
</div> | </div> | ||
<span id="shifrovanie_v_blokchejne"></span> | <span id="shifrovanie_v_blokchejne"></span> | ||
= | = Encryption in the blockchain = | ||
<div class="level1"> | <div class="level1"> | ||
Blockchain technology is perceived by people as something difficult to understand, but in fact the basic idea is simple. To understand the principle of the blockchain, let's find out how data is encrypted using cryptographic algorithms. | |||
</div> | </div> | ||
<span id="zachem_shifrovat_dannye_v_blokchejne"></span> | <span id="zachem_shifrovat_dannye_v_blokchejne"></span> | ||
= | = Why encrypt data in the blockchain = | ||
<div class="level1"> | <div class="level1"> | ||
Thanks to encryption algorithms, blockchain technology is considered the most secure kind of peer-to-peer networks (a network where everyone is equal to each other). To begin with, let's figure out why to encrypt something in the blockchain. | |||
In the traditional and understandable systems "'client-server'"' the security is the responsibility of the company's server, which ensures the security of the storage of funds (the bank's Server), It performs the following functions: | |||
1. ''' | 1. '''Provides user access to data''' .<br /> | ||
It is the server that stores the logins and passwords of its clients, checks the user before giving him access to the network. | |||
2. ''' | 2. '''Monitors the safety of data''' .<br /> | ||
The server takes care of the confidentiality of user data and does not give attackers access to personal data and information. | |||
3. ''' | 3. '''Controls data change''' .<br /> | ||
Any change is agreed with the server before it takes effect. In this way, data integrity is maintained. | |||
''' | '''Since each node in the blockchain is both a server and a client at the same time, and there is no central server, cryptography is used for the above purposes.''' | ||
Cryptographic encryption algorithms perform the above functions without outside interference and now we do not need a bank server for safe storage of funds. Cryptography also answers the question of which encryption algorithm to use for a particular purpose. | |||
</div> | </div> | ||
<span id="algoritm_s_xesh-funkcijami"></span> | <span id="algoritm_s_xesh-funkcijami"></span> | ||
= | = Algorithm with hash functions = | ||
<div class="level1"> | <div class="level1"> | ||
Blockchain developers needed a type of mathematical functions that '''easily encrypts information''' without the possibility of decryption — these are one-way functions. | |||
An example of such a function is multiplication. If we only know the answer, then we cannot say for sure which two numbers were multiplied. | |||
For example, X * Y = 6 | |||
Next, we need a type of one-way functions that '''turns information of arbitrary size into a cipher of a certain length''', and these are hash functions. They convert messages into a set of characters (hashes) that can be conveniently and safely used in programming. | |||
Such a set of characters (Hash) can consist of both letters and numbers. Which numbers and letters will be in the hash, as well as how many of them there will be, depends on the hash function selected. | |||
''' | '''Let's take a closer look at the most famous one — SHA-256, which is also used in the DecimalChain blockchain''' . | ||
</div> | </div> | ||
<span id="kak_rabotaet_xesh-funkcija_sha-256"></span> | <span id="kak_rabotaet_xesh-funkcija_sha-256"></span> | ||
= | = How the SHA-256 hash function works = | ||
<div class="level1"> | <div class="level1"> | ||
The SHA-256 hash function is also used in the bitcoin blockchain. SHA stands for "secure hashing algorithm", and the number 256 is the amount of cache in bits. | |||
The operation of the SHA-256 hash function is conceptually similar to the creation of fingerprints. To identify a person, you do not need to know all the information about him: it is enough to know his fingerprint. "'SHA-256 calculates such a "fingerprint" of texts, videos, images, music and other types of information.''' | |||
''' | '''The algorithm of operation can be described as follows:''' | ||
<ol> | <ol> | ||
<li><div class="li"> | <li><div class="li"> | ||
A message arrives at the input — a file up to 2 million terabytes in size. | |||
</div></li> | </div></li> | ||
<li><div class="li"> | <li><div class="li"> | ||
Mathematical transformations are performed. | |||
</div></li> | </div></li> | ||
<li><div class="li"> | <li><div class="li"> | ||
The output is a hash — a 64-digit number. | |||
</div></li></ol> | </div></li></ol> | ||
You can encode the text and see how the hash function works [http://crypt-online.ru/crypts/sha256 / online here] | |||
[[File:Commoninfo-sha256.png|1000px|class=mediacenter]] | [[File:Commoninfo-sha256.png|1000px|class=mediacenter]] | ||
'''SHA-256 | '''SHA-256 encodes messages instantly''' . The hashes are very different even with a minor change in the message. The hash changes so much that it has absolutely no similarity between the new and old values. Thanks to this, "the SHA-256 hash function guarantees that it is impossible to change the message"' without changing the hash. | ||
A set of letters and numbers in a hash is a single 64—digit number written in a 16-digit number system. To find two different messages with the same hash, you will have to go through them for millennia, so if two messages have the same hash, then be sure: the messages are the same. | |||
</div> | </div> | ||
<span id="tranzakcii_v_blokchejne"></span> | <span id="tranzakcii_v_blokchejne"></span> | ||
= | = Blockchain transactions = | ||
<div class="level1"> | <div class="level1"> | ||
''' | '''Without hash functions, the existence of a blockchain would be impossible.''' | ||
The blockchain is unique in that it guarantees the immutability and anonymity of the data it stores. thanks to encryption algorithms. Any data is checked for authenticity before being entered into the blockchain, but no one can see it. The same thing as a banker checks the authenticity of banknotes lying in a closed safe. This is where the hash function helps. | |||
The blockchain regularly updates the data by adding records of changes — '''transactions'''. When updating transactional information, any system is vulnerable to attack. Banks mitigate this risk with the help of a centralized architecture and one-sided strict control over user access rights. '''The blockchain does not have a centralized control body — it is replaced by cryptographic hash functions.''' | |||
Transactions and their hashes are formed into blocks. The hash in each new block depends on the hash in the previous one. Thus, all transactions ever made can be expressed in one number - the hash of the last block. | |||
''' | '''By changing even one transaction in any of the previous blocks, all subsequent hashes along the chain will change — such a version of the blockchain will be considered invalid.''' | ||
''' | '''The whole principle of blockchain operation is based on hash functions. If one block changes, you will have to restore all subsequent blocks by iteration. To carry out such a search, there will not be enough of any existing computing power''' | ||
</div> | </div> | ||
<div style="clear:both"> | <div style="clear:both"> | ||
</div> | </div> | ||
</div> | </div> | ||
[[Category:Commoninfo]] | [[Category:Commoninfo]] |
edits