views:

116

answers:

1

I am currently trying to port a legacy Python app over to .NET which contains AES encrpytion using from what I can tell pyCrpyto. I have very limited Python and Crypto experience. The code uses the snippet from the following page. http://www.djangosnippets.org/snippets/1095/

So far I believe I have managed to work out that it that it calls Crypto.Cipher with AES and the first 32 character of our secret key as the password, but no mode or IV. It also puts a prefix on the encrpyed text when it is added to database.

What I can't work out is how I can decrypt the existing ecrypted database records in .NET. I have been looking at RijndaelManaged but it requires an IV and can't see any reference to one in python.

Can anyone point me in the dirrection to what method could be used in .NET to get the desired result.

A: 

AES (and Rijndael) requires a mode and an IV. The IV may be a vector of zeroes, but it is still an IV. the mode may not be explicitly specified... but if it's using AES, there's still a mode.

Try this answer for some background:
http://stackoverflow.com/questions/196776/which-aes-library-to-use-in-ruby-python

Cheeso