I'm using AESCryptoServiceProvider in C#/.Net Framework and I'm wondering how large, in bytes, the IV and Keys are. I'm pretty sure that this class follows the specifications of AES so if anyone has any ideas, I'd be happy to hear it :)
AES uses a 128-bit block size, in which data is divided into a four-by-four array containing 16 bytes. Since there are eight bits per byte, the total in each block is 128 bits.
The key file must work only on the corresponding data file. It should not work on any other file, either from the same user or from any other user. AES algorithm requires two different parameters for encryption, a key and an initialization vector (IV).
The AES algorithm requires that the IV size must be 16 bytes (128 bits). So, if we provide an IV whose size is not equal to 16 bytes, an InvalidAlgorithmParameterException will be thrown.
For AES, the legal key sizes are 128, 192, and 256 bits.
The IV size is 16 bytes, and the default key size is 32 (16 and 24 are also allowed) You can use the BlockSize, KeySize, LegalBlockSizes, and LegalKeySizes properties, respectively. The API provides the value in bits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With