How Modern Encryption Algorithms Work: In Simple Terms

blockchain

Modern cryptography is the foundation of computer security. It is based on various mathematical concepts, such as number theory, computational complexity theory, and probability theory.

Today, cryptographic protection methods are used not only to encrypt transactions and control the production of cryptocurrencies, but also to ensure the secure operation of banking systems, plastic cards, ATMs, e-commerce, and wireless devices.

Basic concepts of cryptography

The main component of cryptography is encryption. Messages are encrypted and decrypted using complex algorithms created by combining computer science and mathematics.

Encryption uses an algorithm and a key to convert input data into encrypted output data. This protection method allows only the sender and recipient to view messages, since only those who have the secret key to convert the message into plain text can read the encrypted information.

Symmetric encryption

This is the simplest algorithm. Cryptographers often refer to it as the secret key cryptography (SKC) or common key cryptography, since the same key is used to encrypt and decrypt information. Symmetric encryption implies that the secret digital key must be known to both the recipient and the sender.

Asymmetric encryption

This algorithm is widely used on the World Wide Web. It is also called public key cryptography (PKC). The PKC algorithm uses two keys: public and private.

  • The public key can be known to many. It cannot be used to decrypt data. For example, an email address is a public key.
  • The private key is secret, used to decrypt messages, and never disclosed to the other party. For example, an email account password is the key to opening emails.
  • It does not matter which key is used first, but both are necessary for the process to work.
  • Data can be encrypted using either a public or private key.

Hash functions, hashing

Hash functions are algorithms that, in a sense, do not use a key. They are also called message digests or one-way encryption.

Hash algorithms can be used to convert large amounts of information into a string of binary numbers (bits) of a certain length (hash), which is difficult to imitate. In this way, hash functions ensure the integrity of transmitted files. Two different messages containing different information cannot have the same hash.

A hash can be used as a digital signature or for encrypting and storing passwords. The hashing method is a key aspect of blockchain technology. It mainly concerns the protection of the integrity of data passing through blockchain networks.

Block cipher

It is a type of symmetric encryption. Block cipher encryption means that each block of data is encrypted or decrypted separately, with each bit in the output block depending on each bit in the corresponding input block, but not on other bits. The block size is determined by the algorithm. In most cases, blocks are usually 64- or 128-bit in format. This means that their size is predetermined and always remains the same.

Stream cipher

Uses symmetric encryption. Unlike a block, where all encryption happens at once, stream encryption is done one bit at a time. The conversion of plaintext characters to ciphertext characters depends on their position in the plaintext stream and the key used.

Stream ciphers operate at very high speeds and are less complex in terms of hardware. An important aspect of using stream ciphers is that the initialization vector must never be the same when sending data over a network.

Digital signature (DS)

Digital signatures most often use asymmetric public key cryptography. They have a digital identifier based on a certificate issued by an accredited certification authority (CA). They are part of the mechanism for verifying the security and authenticity of digital messages.

An electronic document containing a DS confirms the authentication of the declared sender, the non-repudiation of the message, and is responsible for the integrity of the transmitted data.

Electronic signatures are commonly used for financial transactions, software distribution, tax and budget reporting, and detecting counterfeit documents or forgeries.

Advantages of cryptography

  • Confidentiality. The use of cryptography protects confidential information from unauthorized access.
  • Non-repudiation, authentication. Messages encrypted with a private key or signed with a digital signature confirm the identity of the declared sender.
  • Access control and management. Cryptography, using various encryption algorithms, provides limited access control to stored or transmitted information. Thanks to this, only secret key holders can decrypt messages.
  • Authentication. Cryptographic methods such as message authentication codes and digital signatures can protect information from substitution and forgery.
  • Data integrity. Cryptographic hashes are used to preserve the integrity of messages. Digests can be used to determine whether information has been altered during transmission over the network.