For security purposes I need to use AES encryption and SHA256/512 in my Django/Python project. I know there are various libraries out there that provide different encryption methods but I can't seem to find a library/package that is FIPS-140 validated. I was wondering if there is solution available for my need? if not which modules/packages are FIPS-140 compliance?


It seems that there is no FIPS-140-2 validated python package. However, AES, SHA-256 and SHA-512 are FIPS-140 compliance, so pycrypto or Cryptography can be used for AES encryption and SHA-256/512.

The closest I could get to a FIPS-140-2 conformance, is to build OpenSSL FIPS Object Module and use it as the backend for Cryptography. But then again since we are using a wrapper, it probably needs to go through FIPS-140-2 validation process again.

Thanks to @TerryChia for his helpful comments.


In the FIPS publication you can see different annexes, in the Annex A: Approved Security Functions it says that AES, SHA-256 and SHA-512 are FIPS-140 compliance.

In the FIPS-140 validated list however I can't see any python module. Therefore seems that there isn't a python module FIPS-140 compliance, so you can use whatever python cryptographic module want if it has an implementation for the algorithms that you mentioned, maybe you can use pycrypto to encrypt using AES or to generate a message digest. Also as you comment cryptography could be a good possibility.

Hope this helps,

  • Do you know if cryptography can be used with OpenSSL FIPS Object Module as its backend which is FIPS-140 validated? – Nima Sep 16 '14 at 0:56
  • Cryptography looks good, however I don't know If it can works with OpenSSL. – albciff Sep 16 '14 at 6:19
  • 1
    @nima Yes, there shouldn't be any problems with that. If there is, open up an issue on GitHub. (Source: I'm one of the developers.) – user10211 Sep 16 '14 at 7:02
  • Thanks @TerryChia I'll give it a try then. How can I point Cryptography to the OpenSSL I build with FIPS Object Module? – Nima Sep 16 '14 at 19:55
  • @nima cryptography.io/en/latest/installation/… – user10211 Sep 17 '14 at 0:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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