Search code examples
encryptionecbblock-cipher

Encryption: TCB (Tweaked CodeBook) algorithm - what is it?


Can someone please provide a description of TCB algorithm?


Solution

  • My cryptographic skills are a little bit rusty - but IMHO, Tweaked Codebook = Tweakable Block Cipher.

    It's basically ECB with a Tweak, that "patches" ECB's biggests flaws: identical plaintext blocks result in identical ciphertext (exposing your ciphertext to malicious substitution and showing data patterns).

    With a plaintext message P, cut in n-bits blocks X1, X2, X3... Xi... Xn

    1. Xi (XOR) Tweak(i) -> CC
    2. Encrypt_function(CC) -> Ci

    Depending on your implementation, your Tweak is generated using a function of your choice (taking your block number as a parameter). A very simple (unsecure?) one could be:

    • Tweak(i) = i

    I'm not 100% OK with my answer; at least that's what I remember and that's what I get when looking at an extract of IEEE 1619-2007. I'd really like to read more on this!