Skip to main content

Module csa

Module csa 

Source
Expand description

CSA combination โ€” block cipher + stream cipher.

DVB-CSA2 encrypt/decrypt consists of two phases applied in a specific order:

Encrypt (scramble):

  1. Block-cipher CBC: encrypt the last block first, then work backward, XORing each plaintext block into the next before encrypting.
  2. Stream-cipher XOR: seed from the (now-encrypted) first block, XOR bytes 8..end.

Decrypt (descramble):

  1. Stream-cipher XOR: seed from the (still-encrypted) first block, XOR bytes 8..end.
  2. Block-cipher CBC undo: decrypt first block, then work forward, XORing each decrypted block into the next before decrypting.

Payloads shorter than 8 bytes are passed through unchanged.

Functionsยง

descramble
Descramble (decrypt) data in-place with the given control word.
scramble
Scramble (encrypt) data in-place with the given control word.