我在c#中以GCM模式实现了AES密码。我的问题涉及“额外的认证数据”(AAD)。在从c#中的GCM实现#
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将非常感激。 谢谢
尽管它使用了不同的库,但下面是C#中AES-GCM的示例http://stackoverflow.com/a/10366194/637783 – jbtule 2012-07-19 21:00:13
谢谢,我希望在看到之前我刚刚写下了自己的 – crawfish 2012-07-19 21:37:43