# Based On Data Processing

Depending upon the chunk of data the encryption algorithm takes to convert the plaintext to ciphertext, the ciphers fall under two categories: the block cipher and the stream cipher. The block cipher is generated by taking a fixed size of bits of data while the stream cipher is generated by taking a single bit of data at a time. These ciphers belong to the family of symmetric-key encryption.

## Stream cipher

As we mentioned, stream ciphers take one bit at a time to covert the plaintext to the ciphertext. It is just like the one-time pad and is an attempt to make the OTP practical. In stream ciphers, instead of using a total random key, we use a pseudorandom key. The pseudorandom key is generated by the pseudorandom generator (PRG). PRG is a function that takes a small seed that may be 128 bits long (say) and expands it to a very long output string, which may be gigabytes long. Now, the question is, can stream ciphers also have perfect secrecy like the OTP? For perfect secrecy, the key length should be equal to the message length, but in the stream cipher, the actual key length is shorter than the message. Therefore, it cannot have perfect secrecy. Now, the question is, if the stream ciphers do not have perfect secrecy, then what makes them secure? The security of stream ciphers depends upon the specific PRG. The PRG must possess a property called unpredictability then the stream cipher is claimed to be secure. Unpredictability can be defined as, given the first *i *bits, there exists no efficient algorithm that can predict the *i *+1 bits with non- negligible advantage. The most common examples of stream ciphers include RC4 and CSS, which are old stream ciphers, and eStream and Salsa20, which are modern stream ciphers.

## Block cipher

The fixed size of bits of data taken by the encryption algorithm is called a block. The commonly used block sizes in popular encryption algorithms are 64 bits, 128 bits and 256 bits. Now, what happens if the plaintext that we are encrypting is less than the block size taken by the algorithm? In this case, padding schemes are used to make the size of the plaintext equal to the block size. Block ciphers are built using the iterations. The most common examples of block ciphers include DES, 3DES and AES. The working details of these algorithms can be found in any standard book; here, we would like to mention the key highlights of these algorithms.

DES (data encryption standard): DES was designed by Horst Feistel in early 1970 at IBM and named Lucifer. In 1976, the National Bureau of Standards (NBS) adopted a variant of Lucifer submitted by IBM as a federal standard and called it a DES with a key length of 56 bits and a block length of 64 bits. In 1997, DES was broken by an exhaustive search where all the 2^{56} combinations of keys were tried to find the challenge key. After DES was broken, the first thing that came to the mind of experts was to strengthen DES against an exhaustive key search attack by artificially expanding the key size. As a result, triple-DES (3DES) was invented. The idea was to iterate DES a couple of times. 3DES uses three independent keys, each of length 56 bits, which makes the key size equals to 168 bits (56x3), but it is three times slower than DES. Now, the question is, why not double DES? If 2DES is used, then there exists an attack called meet in the middle which can try *2 ^{U1}* in a minimal time approximately equal to the exhaustive search attack on DES. DES was a widely used and popular cipher in banking and commerce until the year 2000 when AES completely replaced DES.

AES (advanced encryption standard): AES is a substitution-permutation network (SPN) and unlike the Fiestel network where half of the bits remain unchanged from round to round, in SPN all the bits are changed in every single round. AES comes with three key options, 128 bits, 192 bits, and 256 bits, and the block size is fixed to 128 bits. The larger the key size the more secure is the resulting cipher; however, the number of rounds will increase with the increase in key size thus making the cipher slower. But it is still six times faster than the 3DES standard and hence completely replaced the DES and is a widely used standard nowadays.

# Based On The Type Of Key

On the basis of the type of the keys used for encryption and decryption, ciphers are categorized into symmetric and asymmetric ciphers. In the symmetric ciphers the same key is used for both encryption and decryption while in the asymmetric ciphers different keys are used for encryption and decryption. Examples of symmetric ciphers are block and stream ciphers and all the classical ciphers; in the asymmetric category the most famous and foremost is the cipher developed by Rivest, Shamir and Adleman (RSA algorithm). We will discuss the famous asymmetric ciphers in the section where we discuss public-key encryption techniques.