2009年4月19日星期日

wtf:cipher block chaining

密码段链接(cipher block chaining,CBC)是一种操作分段密码的方式(将一段bit序列加密成一个单独的单元或分成一个密钥提供给整个部分)。密码段链接使用一定长度初始化向量(IV)。它的一个主要特点是完全依靠前面的密码文段来译码后面的内容。因此,整个过程的正确性决定于前面的部分。各部分的顺序必须保持正确。

  在密码段链接中,每个明文段先用前面密文进行异或运算,然后加密。如果密文段顺序不发生改变,使用相同的密钥和初始化向量时,只有同样的密文段可以起作用。因为异或过程隐藏了原文,密码段链接要优于电子密码书模式。

  理论上,两条信息使用相同的密钥加密会产生不同的初始化向量。所以初始化向量不需要保密,这会极大方便某些场合下的应用。
ref: http://www.searchsecurity.com.cn/word_983.htm

Cipher-block chaining (CBC)

CBC mode of operation was invented by IBM in 1976. [1] In the cipher-block chaining (CBC) mode, each block of plaintext is XORed with the previous ciphertext block before being encrypted. This way, each ciphertext block is dependent on all plaintext blocks processed up to that point. Also, to make each message unique, an initialization vector must be used in the first block.

ref: http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher-block_chaining_.28CBC.29
这个图看的很清晰

没有评论:

发表评论