我在 C# 中以 GCM 模式实现 AES 密码。我的问题与“其他经过身份验证的数据”(AAD)有关。在以下代码中
http://blogs.msdn.com/b/shawnfa/archive/2009/03/17/authenticated-symmetric-encryption-in-net.aspx
目前还不清楚我应该从哪里获得 AAD,以及在解密期间我应该如何检索特定于该加密的 AAD:
// Authenticated data becomes part of the authentication tag that is generated during
// encryption, however it is not part of the ciphertext. That is, when decrypting the
// ciphertext the authenticated data will not be produced. However, if the
// authenticated data does not match at encryption and decryption time, the
// authentication tag will not validate.
aes.AuthenticatedData = Encoding.UTF8.GetBytes("Additional authenticated data");
任何有关如何使用此 AAD 的说明将不胜感激。谢谢