encryption - How to use AES CBC using a key longer than 256 bits in Python -


anyone have way encrypt/decrypt using python handle aes in cbc mode key of 1024 bits (128 bytes)? aes pkgs found far seem limited 256 bit keys. crypto background limited....

aes defined key sizes of 128, 192 , 256 bit. no way use other key size , still call aes. if want compatible other implementations, have stick defined key sizes.

two common ways key of correct size are:

  • simply slice part of key off toatch 1 of valid sizes. should done if big key created entropy. if not might make brute forcing easier.

  • run big key through hash function such sha-256 256 bit key. again, if big key has low entropy should regard long password , run example through pbkdf2 many iterations.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -