I have some problem with Rijndael! My problem is: If I use inсorrect key in Decrypt method then Rijndael throw CryptographyException! How can I know that key incorrect? Why does it throw an Exception? I thought that the decrypt method would return garbage!
Asked
Active
Viewed 106 times
1 Answers
0
The only thing that can be incorrect regarding Rijndael is that the size of the key is not supported. For AES, the most used configuration of Rijndael, you have to supply keys of length 128, 192 or 256 bits (or 16, 24 or 32 bytes respectively).

Maarten Bodewes
- 90,524
- 13
- 150
- 263
-
The *only* thing? What about padding? Or an incorrect IV is supplied? or (many others things here) – Rushyo Jun 23 '15 at 16:16
-
@Rushyo This is in context of the question asked. And from a theoretical point of view the IV and padding are required for yhe mode of operation, not the block cipher itself. A block cipher allows a key and one block of input (+ possibly a tweak). For Rijndael the key consists of any bit values, so what's left is the key size. – Maarten Bodewes Jun 23 '15 at 16:38