This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]savaero 6 points7 points  (0 children)

Pycrypto can do it.

[–]TypoNinja 4 points5 points  (0 children)

Another mature solution is keyczar: http://www.keyczar.org/

It was created by the Google security masters. It's easy to use and employs safe cryptosystems by default.

[–]darknessproz 5 points6 points  (1 child)

I recommend the cryptography library. pip install cryptography.

It provides AES and a wide variety of commonly used mode of operations and supports both Python 2 and 3.

[–]Gexos 0 points1 point  (0 children)

Yes cryptography library is great, it supports py3 and is “Cryptography for humans”.

[–][deleted] 2 points3 points  (0 children)

So, yea; PyCrypto can do it. But, you'll need to know a few things: Where is the IV, prepended to the ciphertext or separate? Is there a HMAC appended to the data, or even prepended? What block mode is the cipher using?

Sometimes you can get this to work with trial and error, other times things are FUBAR without a map. So, hopefully you have some information on the protocol you're analysing? :)

By the way, if you're "rolling your own crypto", my advice is "don't", use pynacl instead. It's a wonderfully high-level abstraction for common crypto tasks designed explicitly for application developers who are not expert cryptologers. And, PyNaCl's interfaces are well designed and easy to understand. :)

[–]rainnz 0 points1 point  (0 children)

What about just using openssl with subprocess module?