密码文本窃取算法 - 哪一个是正确的?

时间:2010-08-04 16:54:09

标签: algorithm cryptography encryption

网络上有两种算法。

在两种算法中,第一部分都是相同的......

 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

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.

这是正确的解密程序吗?这会扭转第一个加密部分发生的事情吗?

我感到困惑,因为Wikipedia Article具有相同的加密程序,但decryption is different

加密专家可以对我有所了解吗? Thanx提前很多:))

1 个答案:

答案 0 :(得分:4)

这两个描述似乎相同。维基百科文章的第1步和第2步等同于另一篇文章的第一步。维基百科有点正式。

相关问题