kate
kate

Reputation: 123

pycrypto AES passphrase greater than block size

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.

Upvotes: 0

Views: 162

Answers (1)

Benjamin Barenblat
Benjamin Barenblat

Reputation: 1311

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.

Upvotes: 1

Related Questions