0

I have a quick question with reference to pycrypto AES encryption. Suppose I use the accepted answer to the Encrypt & Decrypt using PyCrypto AES 256, and I have my passphrase to AES encryptor > 16 bytes(my block size), will the data be truncated or will it still be encrypted. Please shed some light. Thank you.

Community
  • 1
  • 1
kate
  • 113
  • 1
  • 5
  • 17

1 Answers1

1

I’m not sure, but you should not use the password directly as input to AES. Instead, run your password through a key derivation function like scrypt, bcrypt, or PBKDF2 and use that as your AES key. See my comment regarding KDFs.

Community
  • 1
  • 1
Benjamin Barenblat
  • 1,311
  • 6
  • 19
  • this is correct. see the code for simple-crypt - https://github.com/andrewcooke/simple-crypt (which will support python 2 soon - there's a pull request i need to merge) – andrew cooke Nov 30 '13 at 12:07