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

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

问题描述

有两种算法presented在网上。

There are two algorithms presented in the web.

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

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

然而,对于解密,有两种方法...我真的不知道哪一个是正确的 这一次是从这里

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?

我很困惑的<一个href="http://en.wikipedia.org/wiki/Ciphertext_stealing#CBC_ciphertext_stealing_decryption_using_a_standard_CBC_interface"相对=nofollow>维基百科文章具有相同的加密程序,但<一个href="http://en.wikipedia.org/wiki/Ciphertext_stealing#CBC_ciphertext_stealing_decryption_using_a_standard_CBC_interface"相对=nofollow>解密是不同的

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

可以加密专家阐明了我一些启示?感谢名单很多提前:)

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天全站免登陆