I’ve experienced some trouble encrypting and decrypting data between the server and client application I’m developing. I’m using AES implementation using a script that can be downloaded here at birth-online.de.
The implementation is working just fine when I’m trying to encode or decode data on my Ubuntu 10.04 Server. However, when trying to use the script under Windows I’m getting the following Exception thrown at me:
>>> aes.encrypt("Test", "Test", 256)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "aes.py", line 148, in encrypt
key = Cipher(pwBytes, KeyExpansion(pwBytes))
File "aes.py", line 112, in KeyExpansion
w = [0] * Nb*(Nr+1)
TypeError: can't multiply sequence by non-int of type 'float'
Does anyone know what’s going wrong exactly and how to fix it? I’ve searched Google already, but can’t seem to find anything useful regarding this Exception. I’m using Python 3.2.1 on my Windows (x64) testmachine and my Ubuntu server is running Python 2.6.5. (Could the version make the difference here, by the way?)
Thanks in advance!
Robert
I would try using PyCrypto, I use it in a current project of mine and it has worked very well. You can learn more about it below:
https://www.dlitz.net/software/pycrypto/