天天看點

Cryptographic Chaining ModeCipher Chaining

Cipher Chaining

ECB(electronic codebook) mode

  • Same plain text produce the same cipher text
  • No error propagation
  • Residue is NO_HANDLE
Cryptographic Chaining ModeCipher Chaining
Cryptographic Chaining ModeCipher Chaining

plain text –CW encrypt–> cipher text

cipher text –CW decrypt–> plain text

Cryptographic Chaining ModeCipher Chaining

CBC(cipher block chaining) mode

  • Same plain text produce the different cipher text
  • Error propagation to next block
  • Need initialization vector
Cryptographic Chaining ModeCipher Chaining
if A ^ B = C
then C ^ A = B, C ^ B = A
           
Cryptographic Chaining ModeCipher Chaining
Cryptographic Chaining ModeCipher Chaining

p(n) xor iv/p(n-1) –CW encrypt–> c(n)

c(n) –CW decrypt–> xor iv/c(n-1) –> p(n)

Residue mode

ANSI(American National Standard Institute) SCTE(Society of Cable Telecommunications Engineers) 52

Cryptographic Chaining ModeCipher Chaining

c(n-1) –>CW encrypt–> c’(n) –> xor short p(n) –> short c(n)

c(n-1) –>CW encrypt–> c’(n) –> xor short c(n) –> short p(n)

CTS(cipher text stealing)

Cryptographic Chaining ModeCipher Chaining
Cryptographic Chaining ModeCipher Chaining
encrypt:

Remain = sizeof(short p(n))

p’(n) = short p(n) + 0[Remain, Block_Len]

c(n) = c(x)[1, Remain]

p(n-1) xor c(n-2) –CW encrypt–> c(x) –> c(n)

p(n) –> p’(n) –> xor c(x) –> p(x) –CW encrypt–> c(n-1)

decrypt:

c(x) = short c(n) + p(x)[Remain+1, Block_Len]

p(n) = p’(n)[1, Remain]

c(n-1) –CW decrypt–> p(x) –> xor c(x) –> p’(n) –> short p(n)

c(x) –CW decrypt–> xor c(n-2) –> p(n-1)

CFB(cipher feedback) mode

  • Same plain text produce the different cipher text.
  • Need iv.
  • Error propagation to next block.
  • Residue is NO_HANDLE.
Cryptographic Chaining ModeCipher Chaining

iv/c’(n-1) –CW encrypt–> c’(n) –> xor p(n) –> c(n)

iv/c’(n-1) –CW encrypt–> c’(n) –> xor c(n) –> p(n)

OFB(output feedback) mode

  • Same plain text produce the different cipher text.
  • Need iv.
  • No error propagation.
  • Residue is NO_HANDLE.
  • One error bit of cipher text only cause one error bit of plain text.
Cryptographic Chaining ModeCipher Chaining

iv/c’(n-1) –CW encrypt–> c’(n) –> xor p(n) –> c(n)

iv/c’(n-1) –CW encrypt–> c’(n) –> xor c(n) –> p(n)

CTR(counter) mode

  • Same plain text produce the different cipher text.
  • Need initialization counter.
  • No error propagation.
  • Residue is NO_HANDLE, but it’s cipher text.
  • One error bit of cipher text only cause one error bit of plain text.
Cryptographic Chaining ModeCipher Chaining

iv(n-1) – counter –> iv(n)

iv(n) –CW encrypt–> xor p(n) –> c(n)

iv(n) –CW encrypt–> xor c(n) –> p(n)

Reference:

https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

繼續閱讀