Python crypto modules

Can anyone recommend an encryption / decryption library suitble for use in Panda? I am primarily interested in AES encryption.

Have you taken a look into multifiles?

I should have been more specific. I am looking for a crypto library suitable for use with networking.

Panda uses OpenSSL internally to provide its encryption services. You can use encryptString(‘my string data’, ‘password’) to encrypt a string, and decryptString(‘encrypted data’, ‘password’) to decrypt it. The encryption algorithm can be selected by setting the config variable:

encryption-algorithm bf-cbc

to the algorithm of choice; the default is Blowfish (shown). The available set of encryption algorithms depends on the version of OpenSSL that Panda has been compiled with.

If your goal is to encrypt network communications, though, it might be easier just to use SSL on the socket layer, which is a well-established protocol that virtually every socket library supports.


Thanks David,

I checked the methods section of the API manual and forgot to look in the functions page.

encryptString / decryptString should do fine.

Is there a programmatic way to figure out what algorithms and modes are supported at run time?

No, OpenSSL doesn’t appear to provide one, but the command line “openssl -h” seems to list them. Except that when I try to use one of the “aes” strings, it doesn’t seem to know about it for some reason. Most of the other ciphers listed work just fine, though.