Using Google, you will most probably stumble on Bram Cohen's Rijndael implementation in pure Python.2) I took his code and made it Python3 ready by replacing all
range(), all divisions (
/) by integer-divisions (
//) and made the
string.join() working. There were no more changes neccessary.
See the working Python class here: rijndael.py (10.69 KiB, 762 downloads)
Another Rijndael implementation I found was pyRijndael. After changing the two
int() and adding parentheses to all the
I ported the same library to Python to let Python talk to a PHP server in an encrypted way.
Download it here: aes.py (7.59 KiB, 663 downloads)
import aes text = "Hello, world!" password = "itsmysecret" blocksize = 256 # can be 128, 192 or 256 crypted = aes.encrypt( text, password, blocksize ) # do something decrypted = aes.decrypt( crypted, password, blocksize )