What (pure) Python library to use for AES 256 encryption? [closed] What (pure) Python library to use for AES 256 encryption? [closed] python python

What (pure) Python library to use for AES 256 encryption? [closed]


https://github.com/caller9/pythonaes

That is pure python with PKCS7 padding. Supports CBC, CFB, and OFB modes.

The problem is that python is not super fast for this type of thing. The code from serprex's fork is a little bit inscrutable, but much faster than mine due to using all kinds of tricks to squeeze every last bit of speed out of Python.

Really though, the best libraries for this are compiled and hook into SSE/MMX stuff.

Also Intel is baking in AES instructions since the Core(tm) line of chips.

I wrote my version to get a true pure Python version out there to be able to run on any architecture, cross-platform, and with 3.x as well as 2.7.


PyCrypto should be the one for you.

Edit 02/10/2020: unfortunately I cannot delete this post, since it's the accepted answer. As people pointed out in the comments, this library is not mantained anymore and probably also vulnerable from a security point of view. So please, take a look to the below answers instead.


Since I found this question when searching for the same thing I would like to add another one to the list:

SlowAEShttp://code.google.com/p/slowaes/
It's a development of Josh Davis' code, with the help of some other people. It seems to work fine.