Counter (CTR)
- Note: CTR mode (CM) is also known as integer counter mode (ICM) and segmented integer counter (SIC) mode
Like OFB, counter mode turns a block cipher into a stream cipher. It generates the next keystream block by encrypting successive values of a "counter". The counter can be any function which produces a sequence which is guaranteed not to repeat for a long time, although an actual increment-by-one counter is the simplest and most popular. The usage of a simple deterministic input function used to be controversial; critics argued that "deliberately exposing a cryptosystem to a known systematic input represents an unnecessary risk." By now, CTR mode is widely accepted, and problems resulting from the input function are recognized as a weakness of the underlying block cipher instead of the CTR mode. Nevertheless, there are specialized attacks like a Hardware Fault Attack that is based on the usage of a simple counter function as input.
CTR mode has similar characteristics to OFB, but also allows a random access property during decryption. CTR mode is well suited to operation on a multi-processor machine where blocks can be encrypted in parallel. Furthermore, it does not suffer from the short-cycle problem that can affect OFB.
Note that the nonce in this graph is the same thing as the initialization vector (IV) in the other graphs. The IV/nonce and the counter can be combined together using any lossless operation (concatenation, addition, or XOR) to produce the actual unique counter block for encryption.
Read more about this topic: Block Cipher Modes Of Operation
Famous quotes containing the word counter:
“Id take the bus downtown with my mother, and the big thing was to sit at the counter and get an orange drink and a tuna sandwich on toast. I thought I was living large!... When I was at the Ritz with the publisher a few months ago, I did think, Oh my God, Im in the Ritz tearoom. ... The person who was so happy to sit at the Woolworths counter is now sitting at the Ritz, listening to the harp, and wondering what tea to order.... [ellipsis in source] Am I awake?”
—Connie Porter (b. 1959)