Need solution for wrong IV length in AES

后端 未结 5 1107
南旧
南旧 2020-12-08 18:17

I\'m trying to implement AES in Java and this is the code I use:

 byte[] sessionKey = {00000000000000000000000000000000};
 byte[] iv = {000000000000000000000         


        
5条回答
  •  执笔经年
    2020-12-08 18:30

    From Advanced Encryption Standard:

    The standard comprises three block ciphers, AES-128, AES-192 and AES-256, adopted from a larger collection originally published as Rijndael. Each of these ciphers has a 128-bit block size, with key sizes of 128, 192 and 256 bits, respectively

    (Emphasis added)

    From Initialization Vector:

    For block cipher modes of operation, the IV is usually as large as the block size of the cipher

    Combine those two factors together, and you get that the IV is always 128 bits for AES, independent of the key size.

提交回复
热议问题