AEAD模式安全

AEAD mode security

我读书的时候Botan document, 我看到了以下注释:

During decryption, finish will throw an instance of Integrity_Failure if the MAC does not validate. If this occurs, all plaintext previously output via calls to update must be destroyed and not used in any way that an attacker could observe the effects of.

One simply way to assure this could never happen is to never call update, and instead always marshall the entire message into a single buffer and call finish on it when decrypting.

由于解密中出现了这种情况, 如果攻击者可以访问文件,这是否意味着 AEAD 模式不安全?

还是我理解错了什么?

提前致谢。

此警告的要点是您不能信任任何未经验证的信息。请注意,AEAD 密码的底层模式通常是 CTR 模式(其他模式同样受到影响)。因此,例如,攻击者可以在密文中引入错误,这些错误会在同一位置转化为明文中的错误。大多数 AEAD 密码在底层使用 CTR 模式,因此攻击者可以那样翻转明文的特定位。

例如,攻击者可以通过观察在处理现在无效的数据时发生的特定错误来了解明文。这就是警告的内容:您首先需要在处理解密数据之前确定其完整性和真实性。

当然,这通常意味着缓存数据直到它被验证。出于这个原因,首先创建一个缓冲区并用密文加载它更有意义。如果你有一个好的API,你可以用明文覆盖它,这样你就不必两次分配存储空间space。

当然,您仍然可以将纯文本存储在磁盘上,只要确保在标签无效时删除对数据的访问权限即可。例如,您可以将数据存储在一个临时文件中,然后在验证标签后将其重命名为正确的文件名


综上所述,不,AEAD 模式比任何其他未经身份验证的操作模式 安全,因为您可以验证消息的完整性和真实性。但是你仍然可以错误地使用密码,这就是全部。