Residual block termination

From Wikipedia, the free encyclopedia

In cryptography, residual block termination is a variation of cipher block chaining mode (CBC) that does not require any padding. It does this by effectively changing to cipher feedback mode for one block. The cost is the increased complexity.

[edit] Encryption procedure

If the plaintext length N is not a multiple of the block size L:

  • Encrypt the ⌊N/L⌋ full blocks of plaintext using the cipher block chaining mode;
  • Encrypt the last full encrypted block again;
  • XOR the remaining bits of the plaintext with leftmost bits of the re-encrypted block.

[edit] Decryption procedure

  • Decrypt the ⌊N/L⌋ full encrypted blocks using the Cipher Block Chaining mode;
  • Encrypt the last full encrypted block;
  • XOR the remaining bits of the ciphertext with leftmost bits of the re-encrypted block.

Proof that this decryption procedure really is the inverse of the encryption procedure is left as an exercise for the reader.

[edit] Short message

For messages shorter than one block, residual block termination can use an encrypted IV instead of the previously encrypted block.


Block ciphers
v  d  e
Algorithms: 3-Way | AES | Akelarre | Anubis | BaseKing | Blowfish | C2 | Camellia | CAST-128 | CAST-256 | Cobra | CMEA | Crab | CS-Cipher | DEAL | DES | DES-X | DFC | FEAL | FROG | G-DES | GOST | Grand Cru | Hasty Pudding Cipher | ICE | IDEA | IDEA NXT | Iraqi | KASUMI | KHAZAD | Khufu and Khafre | Libelle | LOKI89/91 | LOKI97 | Lucifer | MacGuffin | Madryga | MAGENTA | MARS | Mercy | MESH | MISTY1 | MMB | MULTI2 | NewDES | NOEKEON | NUSH | Q | RC2 | RC5 | RC6 | REDOC | Red Pike | S-1 | SAFER | SC2000 | SEED | Serpent | SHACAL | SHARK | Skipjack | SMS4 | Square | TEA | Triple DES | Twofish | XTEA
Design: Feistel network | Key schedule | Product cipher | S-box | SPN   Attacks: Brute force | Linear / Differential / Integral cryptanalysis | Mod n | Related-key | Slide | XSL
Standardization: AES process | CRYPTREC | NESSIE   Misc: Avalanche effect | Block size | IV | Key size | Modes of operation | Piling-up lemma | Weak key
Cryptography
v  d  e
History of cryptography | Cryptanalysis | Cryptography portal | Topics in cryptography
Symmetric-key algorithm | Block cipher | Stream cipher | Public-key cryptography | Cryptographic hash function | Message authentication code | Random numbers