Counter Mode (CTR) is another type of Block Ciphers. CTR encrypts an increasing counter value and then XORs with plaintext block, where we must have a different counter value for every plaintext block (never reused). The figure below shows the CTR operation.
Advantages and Limitations of CTR operation:
- Can do parallel encryptions in both hardware and software.
- Can pre-process Oi values in advance.
- Good for high speed links.
- CRT operation has a random access to encrypted data blocks.
- Provable security (as good as other modes), but must ensure never reuse counter values (otherwise could break).
Important: Block Ciphers can be used to emulate Stream Ciphers.
In summary, ECB operation is weak. Thus, we used CBC operation instead. Also, the CTR operation turns a Block Cipher into a Stream Cipher.
The link below provides more practical work on symmetric encryption (Crypto Lab).