我在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