网络上提出了两种算法。
在这两种算法中,第一部分是相同的......
1. Pad the last partial plaintext block
with 0.
2. Encrypt the whole padded plaintext
using the standard CBC mode.
3. Swap the last two ciphertext blocks.
4. Truncate the ciphertext to the length of the original plaintext
然而对于解密,有两种方法......我真的不知道哪一种是正确的
这张取自here http://www.wordiq.com/definition/Ciphertext_stealing
1. If the ciphertext length is not a multiple of the block size, say it is n bits short, then pad it with the last n bits of the block cipher decryption of the last full ciphertext block.
2. Swap the last two ciphertext blocks.
3. Decrypt the ciphertext using the Cipher Block Chaining mode.
4. Truncate the plaintext to the length of the original ciphertext.
这是正确的解密过程吗?这会逆转第一个加密部分中发生的情况吗?
我很困惑维基百科文章 http://en.wikipedia.org/wiki/Ciphertext_stealing#CBC_ciphertext_stealing_decryption_using_a_standard_CBC_interface具有相同的加密过程,但解密不一样 http://en.wikipedia.org/wiki/Ciphertext_stealing#CBC_ciphertext_stealing_decryption_using_a_standard_CBC_interface
密码学专家可以帮我解释一下吗?提前非常感谢:)
这两个描述看起来是等价的。维基百科文章的步骤 1 和 2 相当于另一篇文章的第一步。维基百科更正式一些。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)