# why DES encryption uses different modes like ECB,OFB?

As without using modes we can also encrypt and decrypt data then what is the need of using modes in DES?

• Without a mode you can encrypt exactly 8 bytes in a deterministic way. If you want to do anything more, you need a mode. Aug 8, 2013 at 10:57
• If you look at it in a logical way, it's more the other way around; the mode uses the block cipher to perform the block encryption. It may also use a padding mechanism when required. Aug 8, 2013 at 12:03

DES is a block cipher. It consists of a pair of algorithms, one for encryption and one for decryption. Each algorithm takes two inputs: the key, and the block to encrypt or decrypt; the output is the encrypted or decrypted block. For DES, the size of a block is 64 bits. So DES only tells you how to encrypt or decrypt data that consists of exactly 64 bits.

If you have more or less than 64 bits of data, you need to specify how the data is split into 64-bit blocks, what processing to apply to each block, and how to combine the output blocks together. By definition, this is called a mode of operation. Usually the splitting and combining is trivial, but the part about processing each block can be more or less complex.

Even when you happen to have exactly one block of data, modes can achieve things that DES alone doesn't. In particular, DES is deterministic: encrypting the same plaintext with the same key always leads to the same ciphertext. All good modes include a unique tag as part of the encrypted data (called an initialization vector in most modes), so that no two runs of the encryption algorithm ever produce the same ciphertext, which avoids leaking the fact that two messages are equal. Modes can also build algorithms that do things other than encryption, such as a message authentication code, or authenticated encryption which combines encryption and MAC together in a single algorithm.

Most real-world encryption is based on block ciphers, which transform fixed-sized inputs into fixed-sized outputs. Since real-world inputs aren’t exactly 8 or 16 bytes wide, ciphers are adapted to them with a block mode. Of the available block modes, ECB is the simplest to understand. It’s the mode you’d design yourself, the first time you confronted a block cipher: divide the input into blocks, and apply the cipher to each independently. ECB mode is so widespread that we call it “the default mode”.

http://sockpuppet.org/blog/2013/07/22/applied-practical-cryptography/

As said in this block, encryption algorithms are able to encrypt just one block, but usually, a message to protect is longer, for this reason you should chop it and encrypt every single piece, to bind them togheter you need a mode.