CTR mode

Counter mode ( CTR) is a mode in block ciphers can be used to generate a stream cipher thereof. In this case a generated ciphertext block using the XOR operation is combined with the plaintext.

General

The peculiarity of the Counter Mode compared to other modes, is the fact that the initialization here from a new for each cipher to be selected random number ( nonce ) associated with a counter is being incremented with each additional block. The link can, for example, done by concatenating ( appending ), addition or XOR.

Encoding

To encrypt an initialization vector is encrypted with the key, producing an intermediate key. This is combined in the connection using an XOR operation with the plaintext. This creates the ciphertext.

Decryption

For decryption, the same counter with the key is re-encrypted in order to obtain the same intermediate key. This is then added by means of an XOR operation on the ciphertext, so that the plaintext is recovered.

Benefits

Counter Mode is as Output Feedback Mode is a mode of operation that allows to operate a block cipher as a stream cipher. The advantages of OFB mode against cipher block chaining mode, Cipher Feedback Mode and other modes, which continue to use plain-text -dependent data for the next block to come to bear here:

  • Bit errors in the transmission result in errors in only the corresponding bits of the plaintext ( instead of making a whole block or possibly even another block unusable )
  • Encryption and decryption are the same, therefore, one-way functions can be used herein
  • The key current can be calculated in advance.

In contrast to the OFB mode but the key for a block depends not on the key for the previous block from, therefore:

  • One has here random access to each encrypted block and
  • All encryption and decryption operations may be performed in parallel.

Areas of application

  • In ZIP archives in combination with AES.
204716
de