Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Chapter 6, Question 6.8, of his book “Cryptography and Network Security Principles and Practices”, William Stalling asks:

Why do some block cipher modes of operation only use encryption while others use both encryption and decryption?

ECB and CBC use encryption function and decryption function while CFB, OFB and CTR use encryption function for decryption as well. What is the logic behind it? Is it because ECB and CBC generates output of Block Cipher type – while CFB, OFB and CTR generates output of Stream Cipher type?

share|improve this question

That is the general idea of it yes.

Some modes of operation (eg CTR) work in such a way that only known values are ever encrypted, forming a stream of pseudo-random data that is then combined with the plaintext by a keyless reversible operation (often xor) to form the ciphertext.

Other modes (eg CBC) directly encrypt secret (ie plaintext) values, meaning decryption is required to find out what the secret value was.

One of the biggest advantages of a scheme that does not require decryption is that it can be implemented in hardware with reduced footprint (ie it's smaller). Moreover, for block ciphers such as AES it can often be easier to implement efficient encryption than decryption because the internal coefficients have been optimized for this direction.

share|improve this answer

I'm not sure if your understanding is correct. However, to explain it a bit to be sure you’re on the right track…

Some mode of operation only use an encryption function because it is used to generate something to XOR with the plaintext. There is no point decrypt the generated bytes. To decrypt the ciphertext, you just need the same stream of bytes.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.