Ciphers

Intermediate
March 27, 2023
Read time:
11m

Cipher is a cryptographic term referring to an algorithm or function used to encrypt specific data (via cipher algorithms). They utilize conversion methods to protect data from unauthorized access. Cipher’s structure is based on complex mathematical calculations, ensuring resistance to breaches.


Within blockchain technology, cryptography is crucial for encrypting transactions to grant security and integrity. Specifically, before sending a transaction, its owner signs it with their private key and then encrypts it using the recipient's public key. The recipient may then decrypt the transaction using their private key.

Data is stored in blocks and linked together to form a coherent chain. Each block contains multiple transactions, each requiring a digital signature using the private key of the wallet owner in question.


Encryption is also utilized to create hashes of blocks – a unique code used to identify the block and start the next block in the blockchain (e.g., SHA-256 can generate the hash).

Encryption provides the security of transactions, as each is digitally secured. Nevertheless, we should ensure our private keys are strong to reduce the likelihood of security breaches further.

Types of ciphers

Block Ciphers

Block Ciphers work on fixed-length blocks of data, typically 128 bits. These algorithms encrypt plaintext by dividing it into blocks and then applying a series of mathematical operations (known as rounds) to each, using a secret key. The output of each round is used as input to the next round until the final output (ciphertext) is generated.


Block ciphers are widely used in modern cryptography to provide confidentiality, integrity, and authenticity of data. They are used in a variety of applications, including secure communication protocols like (VPNs) and electronic payment systems.

Some popular examples of block ciphers include Advanced Encryption Standard (AES), Data Encryption Standard (DES), and Blowfish.

DES (Data Encryption Standard)

A type of cipher developed in the 1970s and used for many years in banking, telecommunications, and military applications. DES operations relied on data blocks of 64 bits and used a key size of 56 bits – the encryption consisted of 16 rounds of operations.

Unfortunately, over time DES became vulnerable to brute-force attacks that tested every possible key combination (a key length of 56 bits required 72 trillion combinations to breach).


AES was adopted and validated in response to these threats, with DES now not being recommended for cryptographic applications.

AES (Advanced Encryption Standard)

This symmetric block encryption was first published in 1998 and approved by the National Institute of Standards and Technology (NIST) three years later, replacing the earlier DES standard. AES is used in applications encrypting data transmission over the Internet or virtual private networks (VPNs).

Presently, AES is considered one of the most popular ciphers available and is deemed secure and effective. With AES, an encryption procedure consists of repeatedly passing a block of data through a unique function incorporating logical and arithmetic operations - AES applies a key length of 128, 192, or 256 bits to encrypt a block of data of 128 bits.


Its high resistance to cryptanalytic attacks has also contributed to the success of AES - practically, it is unbreakable.

Stream Ciphers

Stream ciphers operate on individual bits or bytes of plaintext to produce a corresponding ciphertext stream. Unlike block ciphers, they produce ciphertext continuously as plaintext is fed into the algorithm.

Typically, a secret key generates a keystream – a stream of random characters combined with the plaintext to produce the ciphertext. Stream ciphers are commonly used in applications that require real-time encryption and decryption, such as wireless communications.


However, they are generally considered less secure than block ciphers.

Asymmetric Key Algorithms

A type of cipher that uses two keys – a public key and a private key – for encryption and decryption of data. The private key is kept secret and known only to the recipient, while the public key can be shared with anyone.


Asymmetric cryptography is commonly used in applications that require secure communication over an insecure channel, such as online banking, email, and digital signatures. It may also be combined with symmetric key algorithms to provide an additional layer of security.

The most common types of asymmetric cryptography algorithms include: RSA (Rivest-Shamir-Adleman) and Elliptic Curve Cryptography (ECC) which use elliptic curves' mathematical properties for encryption and decryption.

RSA (Rivest-Shamir-Adleman)

RSA uses two types of keys - the private key, kept secret by the owner, as well as the public key, shared with those who wish to encrypt a message to its owner.


The encryption process is based on mathematical operations on the integers. It employs the factorization of large prime numbers (for example, 2^82,589,933 - 1 - known as Mersenne's number) - and consists of raising the message to the power of the public key, making it practically impossible to hack. Decryption, however, involves raising the ciphertext to the power of the private key.


Among the uses of RSA is the digital signatures to ensure the authenticity and integrity of the data - signatures in RSA work by transforming the message hash with a private key. Doing so verifies that the data has not been modified during transmission.

Symmetric Key Algorithms

In contrast to the Asymmetric Key Algorithms, this type of cipher uses the same key for both data encryption and decryption. Symmetric key algorithms are commonly used in applications that require high-speed encryption and decryption, such as securing data during transit over a network or securing data on a hard drive.

Summary

Cipher is a series of instructions that can be followed to encrypt or decrypt a text message. They are crucial in blockchain technology to ensure the security and integrity of transactions. AES, RSA, and DES are examples of ciphers, with AES being the most popular, highly secure, and effective.

Complete quiz
Ciphers
Share this article
Explore other articles
Beginner

How to create entry and exit strategies?

You can create your entry and exit strategies using technical and fundamental analysis. Ask yourself what your desired risk/reward ratio, number of trades, and win rate are to strategize according to your needs.
Beginner

What is a whitepaper?

Whitepaper is a thorough, informative report outlining a specific problem and suggested solutions. They are commonly used to promote a product, build authority in the industry, and focus on the potential of technology to attract investors.
Intermediate

Introduction to risk management strategies for cryptocurrencies: Trailing Stops

Trailing stops can be a powerful tool for managing risk and improving trading performance in volatile markets.