# Cryptography and data encryption – all you need to know

()

## What is cryptography

Cryptography is known to many as the heart of the blockchain and the basis of all cryptocurrencies, but not everyone thinks that we use it daily. The cryptography method is used in most modern applications and hides personal data from prying eyes.

Cryptography is a science that studies how to conceal data and ensure its confidentiality. This is one of the oldest sciences and its history has four millennia. The term “cryptography” itself was formed from two ancient Greek words “crypto” – hidden, “grapho” – I write. For beginners, the principle of cryptography can be explained by the example of Caesar’s cipher, where each symbol of the alphabet has been replaced by one that is in 3 positions to the desired one.

The first examples of cryptography records were mono-alphabetic and began to appear from the third millennium BC. They were records whose text was changed by substituting other characters. Starting in the 9th century, polyalphabetic ciphers began to be used, and from the middle of the 20th, electromechanical ciphers began to be used, but printing ciphers were still used.

Until 1975, cryptography was an encryption method with a secret key that provided access to data decryption. Later, the period of its modern development began and methods of public-key cryptography were developed, which can be transmitted over open communication channels and used to verify data.

Modern applied cryptography is a science formed at the intersection of mathematics and computer science. A related science of cryptography is cryptanalysis. Cryptography and cryptanalysis are closely interrelated, only in the latter case, ways to decrypt hidden information are studied.

With the modification to the public key, cryptography became more widespread and began to be used by private individuals and commercial organizations, and in 2009, the first Bitcoin cryptocurrency was issued on its basis. Until that time, it was considered the prerogative of government bodies.

### Types of Cryptography

Cryptographic systems are based on various types of cryptography. There are four main cryptographic primitives:

• Symmetric Encryption This method prevents data being intercepted by third parties and is based on the fact that the sender and receiver of the data have the same keys to solve the cipher.
• Asymmetric encryption. This method uses the public and private keys. Keys are interconnected – information encrypted with a public key can only be disclosed by a secret key associated with it. It is impossible to use keys from different pairs for clues, since they are interconnected by a mathematical relationship.
• Hashing The method is based on converting the source information into bytes of a given pattern. The conversion of information is called a hash function, and the result is a hash code. All hash codes have a unique character sequence.
• Electronic signature. This is a conversion of information using a private key, allowing you to confirm the authenticity of the document and the absence of data corruption.

### Features and applications

Initially, cryptography was used by the government to securely store or transmit documents. Modern asymmetric encryption algorithms are more widely used in the field of IT security, and symmetric methods are now used mainly to prevent unauthorized access to information during storage.

In particular, cryptographic methods are used for:

• Safe storage of information by commercial and private individuals;
• Implementation of digital electronic signature systems;
• Certificate of Authentication
• Secure online data transfer through open communication channels.

### Cryptography and blockchain

In the blockchain, cryptography is used to protect and ensure the confidentiality of personalities and personal data, maintaining high transaction security, reliable protection of the entire system and storage.

#### Function hash

The hash functions in the blockchain are interconnected, with their help information security and the irreversibility of transactions are achieved. Each new transaction block is associated with the hash of the previous block, which in turn is formed on the basis of the hash of the last block formed before it. Thus, each new transaction block contains all the information about previous blocks and cannot be falsified or changed.

In order for the new block to be added to the blockchain chain, the network must come to a common consensus and pick up the hash of the new block. To do this, with the help of computer technology, miners offer many “nonce” – options for the value of the function. The first miner, who managed to randomly generate a hash suitable for combination with previous data, signs a block to it, which is included in the chain, and the new block will already have to contain information with it.

Thanks to the use of hashing technology in the blockchain, all transactions that were performed in the system can be expressed with a single hash of the new block. The hashing method makes it almost impossible to hack the system, and with the addition of each new block, the blockchain’s resistance to attacks only increases.

#### Digital signatures

The asymmetric cryptography method based on public and private keys is used in the blockchain. The public key serves as the address for storing coins, the secret key is the password for access to it. The private key is based on the public key, but it cannot be calculated mathematically.

Among the many public-key cryptography schemes, the most common is the scheme based on elliptic curves and the scheme based on factorization. In bitcoin, the first scheme is involved – elliptic curves. The private key in it is 32 bytes in size, the public key is 33 bytes, and the signature takes about 70 bytes.

#### Public Key Cryptography

Modern public-key cryptography is used in the blockchain system to transfer coins.

For dummies, the principle of cryptography based on public keys can be explained by the example of a transaction. Let’s say the sender wants to send 1 bitcoin. To do this, he needs to send a transaction where it will be indicated where to get the coin from and where it will be sent (public key of the recipient). When the transaction is formed, the sender must sign it with his secret key. Next, the communication nodes verify the correspondence of the sender’s secret key with its public key, with which the coin is currently associated. If the conditions are met, that is, the sender’s public and private keys are interconnected, then the sent coin will begin to be associated with the recipient’s public key.

### Conclusion

Cryptography is an important component of the modern world and is necessary primarily for the preservation of personal data and important information. Since its inception, it has gone through many modifications and is now a security system that can hardly be cracked. It is difficult to overestimate its capabilities for humanity. Modern cryptography methods are used in almost all industries in which there is a need for secure data transfer or storage.