08-13-2020, 01:36 AM
There are 8 bits in 1 byte.
So to get the correct number of bytes you should divide them by 8.
128/8 = 16 bytes
192/8 = 24 bytes
256/8 = 32 bytes
So your key length must be either 16, 24, or 32 to be recognized as valid size.
For example:
128 bit = 16 bytes length key: "0123456789012345"
192 bit = 24 bytes length key: "ABCDEFGHIJKLMNOPQRSTUVWX"
256 bit = 32 bytes length key: "0123456789ABCDEFGHIJKLMNOPQRSTUV"
So to get the correct number of bytes you should divide them by 8.
128/8 = 16 bytes
192/8 = 24 bytes
256/8 = 32 bytes
So your key length must be either 16, 24, or 32 to be recognized as valid size.
For example:
128 bit = 16 bytes length key: "0123456789012345"
192 bit = 24 bytes length key: "ABCDEFGHIJKLMNOPQRSTUVWX"
256 bit = 32 bytes length key: "0123456789ABCDEFGHIJKLMNOPQRSTUV"