AES in GCM mode in Python [closed]

2020-06-01 07:34发布

Does anyone know of a python library or wrapper around a c library that will easily provide Authenticated AES via GCM mode?

PyCrypto does not support it and it does not appear that PyOpenSSL supports direct access to the symmetric cipher portions of OpenSSL

4条回答
闹够了就滚
2楼-- · 2020-06-01 07:36

PyCrypto has added AES-GCM support in the 2.7a1 release. I'm pretty sure this is an alpha release at this point.

https://github.com/dlitz/pycrypto

查看更多
一纸荒年 Trace。
3楼-- · 2020-06-01 07:53

I am looking for exactly the same thing, and strangely enough I cannot find any "official" solutions, just those:

So it looks like the answer above (which I have upvoted) is right, you have to do the maths yourself.. It's a shame there isn't a python wrapper for a C/assembly library because the latest CPUs provide hardware acceleration for those calculations, and we won't benefit from those with a pure python solution.

查看更多
狗以群分
5楼-- · 2020-06-01 07:56

I have just finished looking for an EAX or GCM mode AES encryption algorithm in python. This was a particularly difficult search because I was unable to download the PyCrypto alpha version, which includes both of these, due to a dependency issue.

Eventually I turned to an offshoot of pycrypto that can be pip installed without issue, and has a stable release of GCM.

http://pycryptodome.readthedocs.org/en/latest/src/introduction.html

查看更多
登录 后发表回答