Counter Mode (CTR) Block Cipher

Explore how Counter Mode transforms block ciphers into stream ciphers through interactive visualization

Interactive CTR Mode Demo

CTR Mode Visualization

Step 1: Initialize counter with nonce + counter value
Step 2: Encrypt counter value with block cipher
Step 3: XOR encrypted counter with plaintext block
Step 4: Increment counter for next block

How CTR Mode Works

🔄 Counter Mode Operation

Counter Mode (CTR) converts a block cipher into a stream cipher by:

  • Using a unique counter value for each block
  • Encrypting the counter (not the plaintext directly)
  • XORing the encrypted counter with the plaintext
  • Incrementing the counter for each subsequent block

Advantages of CTR Mode

⚡ Parallelizable

Blocks can be encrypted/decrypted independently

🎯 Random Access

Can decrypt any block without processing others

🔄 Stream Cipher

Converts block cipher into stream cipher

🛡️ No Padding

Works with any message length