密码文本窃取算法 - 哪一个是正确的? [英] Cipher Text Stealing Algorithms - Which one is correct?

查看:484
本文介绍了密码文本窃取算法 - 哪一个是正确的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

网络中有两种算法。

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

In both the algorithms, the first part is the same...

 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

但是对于解密,有两种方法...我真的dunno哪一个是正确的
这一个取自这里

However for decryption, there are two methods... I really dunno which one is correct This one was taken from 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.

这是正确的解密程序吗?这会扭转在第一个加密部分发生了什么吗?

Is this the correct decryption procedure? Will this reverse what happened in the first encryption part?

我困惑为维基百科文章具有相同的加密程序,但解密是不同的

I am confused as the Wikipedia Article has the same encryption procedure but the decryption is different

加密专家能否对我有所了解? Thanx提前很多:)

Can a cryptographic expert shed some light on me? Thanx a lot in advance :)

推荐答案

这两个描述看起来是等价的。维基百科文章的步骤1和2等同于另一篇文章的第一步。维基百科有点更加正式。

The two descriptions seem equivalent. Steps 1 and 2 of the wikipedia article are equivalent to the first step of the other article. Wikipedia is a bit more formal.

这篇关于密码文本窃取算法 - 哪一个是正确的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆