Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Where i can find a "reviewed" version of AES implementation in python. Not an API like PyCrypto whereby you can call AES algorithms in a single line.

share|improve this question
What do you mean by reviewed? Tested with the NIST CMVP? I can provide a pure python AES implementation, but its just a learning tool, not meant for actual usage – calccrypto Jan 16 '13 at 14:51
As a programming question, this might be better off at stackoverflow. – Maarten Bodewes Jan 18 '13 at 23:41
up vote 8 down vote accepted

This is an implementation of AES written completely in Python.

It's not written as a library, it's a program to encrypt files, but looking at the source (which is a single file) the entire AES workings are implemented within it.

There are publicly available test vectors from CMVP for validating that an AES implementation conforms to the spec properly. However, this alone does not address the many pragmatic problems an implementation may have.

share|improve this answer

Have a look at pyCrypto. It is also linked by the official python doc. As you can see in the pyCrypto doc it implements the following encryption algorithms:

AES 16, 24, or 32 bytes/16 bytes
ARC2 Variable/8 bytes
Blowfish Variable/8 bytes
CAST Variable/8 bytes
DES 8 bytes/8 bytes
DES3 16 bytes/8 bytes
IDEA 16 bytes/8 bytes
RC5 Variable/8 bytes

As you already pointed out:

Some modules are implemented in C for performance; others are written in Python for ease of modification. Generally, low-level functions like ciphers and hash functions are written in C, while less speed-critical functions have been written in Python.

There are also some interesting tutorials:

[update] found a python implementation of aes here and here. I did not verify if it works well.

share|improve this answer
AES.c, that's unlikely to be python. – Maarten Bodewes Jan 18 '13 at 23:40

Take a look at tlslite, it offers an AES implementation. The API seems to support CBC mode only though.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.