Encrypt/Decrypt using Bouncy Castle in C#

Your string key = "DFGFRT"; is not 128/192/256 bits.

DFGFRT is 6 characters, which is 6 (or 12?) bytes = 8*12 = 96 bits (at most).

To get a 128 bit key you need a 16 byte string, so I'd go on the safe side and use a 16 character string so it will be a 128 bit key if using single byte characters and 256 if using wide characters.


Fairly simple, your key is "DFGFRT" which is 6 characters/bytes, which is 6 * 8 = 48 bits.

The encryption methods used needs a key of 128/192/256 bits in length, which equals to 16/24/32 characters/bytes.