#2857·CyberChef

Bug report: Encryption/decryption issue with blank Initialization Vector (IV)

Author: zembtachCreated Sep 27, 2026Updated Sep 27, 2026
Labelsbug

I'm trying to use the AES Encrypt operation, but run into an unexpected error after filling out the key:

AES Encrypt - Error in https://gchq.github.io/CyberChef/modules/Ciphers.js on line 2.<br><br>Message: Invalid IV length; got 0 bytes and expected 16 bytes.

This is unexpected, because the operation description reads:

IV: The Initialization Vector should be 16 bytes long. If not entered, it will default to 16 null bytes.

Here is a simple recipe to reproduce:

  1. Go to: https://gchq.github.io/CyberChef/#recipe=AES_Encrypt({'option':'UTF8','string':'My First AES Key'},{'option':'Hex','string':'0000000000000000000000000000000'},'CBC','Raw','Hex',{'option':'Hex','string':''},'Off')&input=dGVzdA
  2. Remove the null bytes and get the error message about Invalid IV length.

The expected behavior is that it will default to 16 null bytes, according to the operation description.

If I take the output from my test and try to decrypt it, that recipe is broken in the same way.

Also, the error message is trying to use <br>, which doesn't render as a line break in the output window, or in the error popup at the bottom of the screen. But that's not the focus of this issue.

Other notes

Your README AES example does still work as expected, so that's fine.

Some other algorithms/operations have the same issue. DES (and Triple DES) says IV will default to 8 null bytes, but doesn't. However, XTEA and RC6 says IV will default to null bytes, and they do.

I'm unsure about other algorithms that don't specifically say in their description, such as SM4.

Thank you