openresty 如何解密带associated_data 的AES_256_GCM

135 views
Skip to first unread message

037E

unread,
May 28, 2021, 12:06:12 PM5/28/21
to openresty
lua-resty-string 中aes gcm 加解密示例都没有associated_data,而是传递tag

实际中的gcm 解密会传递key,iv,associated_data。想请问openresty 中如何通过associated_data 和密文计算出tag 并解密?

BTW,还想问一下openresty 中gcm 加密如何传递associated_data

李俊龙

unread,
Sep 4, 2021, 8:56:57 PM9/4/21
to openresty
查看一下https://github.com/openresty/lua-resty-string 项目中的例子

李俊龙

unread,
Sep 29, 2021, 3:53:07 AM9/29/21
to openresty
https://github.com/openresty/lua-resty-string/blob/master/t/aes.t#L298

你可以看看new 合decrypt的函数,不一定能够满足你的需求。但是你可以照着例子修改。

Reply all
Reply to author
Forward
0 new messages