# Cipher

May 20, 2023

A cipher, also known as an encryption algorithm, is a mathematical function used to encrypt plaintext (unencrypted data) into ciphertext (encrypted data). The purpose of a cipher is to provide secure communication by ensuring that only authorized parties can access the plaintext message. This is achieved by using a secret key to transform the plaintext into ciphertext, which can only be decrypted back to plaintext using the same key.

There are several types of ciphers used in modern cryptography, including symmetric key ciphers, asymmetric key ciphers, and hash functions.

## Symmetric key ciphers

Symmetric key ciphers, also known as shared secret ciphers, use the same key for both encryption and decryption. This means that both the sender and receiver must have the same key in order to communicate securely. The most common symmetric key ciphers include AES (Advanced Encryption Standard), DES (Data Encryption Standard), and Blowfish.

### AES (Advanced Encryption Standard)

AES is a symmetric key cipher that was established by the National Institute of Standards and Technology (NIST) in 2001. It is widely used in modern cryptography due to its high level of security and efficiency. AES supports key sizes of 128, 192, and 256 bits, and is used in a variety of applications, including SSL/TLS, disk encryption, and wireless network security.

### DES (Data Encryption Standard)

DES is a symmetric key cipher that was developed by IBM in the 1970s. It uses a 56-bit key to encrypt and decrypt data, making it less secure than modern ciphers such as AES. Despite its weak security, DES is still used in some legacy systems and applications.

### Blowfish

Blowfish is a symmetric key cipher that was developed by Bruce Schneier in 1993. It is similar to AES in terms of security and efficiency, but supports key sizes of up to 448 bits. Blowfish is used in a variety of applications, including file encryption, password storage, and VPNs.

## Asymmetric key ciphers

Asymmetric key ciphers, also known as public key ciphers, use two keys: a public key and a private key. The public key is used to encrypt data, while the private key is used to decrypt data. This means that anyone can send encrypted messages to the owner of the private key, but only the owner can decrypt the messages. The most common asymmetric key ciphers include RSA (Rivest-Shamir-Adleman) and ECC (Elliptic Curve Cryptography).

### RSA (Rivest-Shamir-Adleman)

RSA is an asymmetric key cipher that was developed by Ron Rivest, Adi Shamir, and Leonard Adleman in 1977. It is widely used in modern cryptography due to its high level of security and efficiency. RSA supports key sizes of up to 4096 bits, and is used in a variety of applications, including SSL/TLS, digital signatures, and key exchange.

### ECC (Elliptic Curve Cryptography)

ECC is an asymmetric key cipher that is based on the mathematics of elliptic curves. It is similar to RSA in terms of security and efficiency, but uses smaller key sizes. ECC is used in a variety of applications, including SSL/TLS, digital signatures, and key exchange.

## Hash functions

Hash functions are mathematical functions that take input data and produce a fixed-size output. The output is typically a string of characters that represents the input data in a unique way. Hash functions are used in modern cryptography to verify the integrity of data, as well as to store passwords securely. The most common hash functions include SHA-1 (Secure Hash Algorithm 1) and SHA-256 (Secure Hash Algorithm 256).

### SHA-1 (Secure Hash Algorithm 1)

SHA-1 is a hash function that produces a 160-bit output. It was developed by the National Security Agency (NSA) in 1995, and is widely used in modern cryptography. However, SHA-1 is no longer considered secure, as it is vulnerable to collision attacks.

### SHA-256 (Secure Hash Algorithm 256)

SHA-256 is a hash function that produces a 256-bit output. It was also developed by the NSA, and is widely used in modern cryptography. SHA-256 is considered more secure than SHA-1, as it is not vulnerable to collision attacks.