Cyberchef: Bug report: AES Encryption with cipher text of null string appended?

Created on 15 Oct 2018  路  2Comments  路  Source: gchq/CyberChef





Summary

Encrypting a 16-byte text results in its own 16-byte cipher text with cipher text of null string appended.

Example



Recipe 1

Encrypt hex "00000000000000000000000000000000" with AES-128-ECB with key hex "00000000000000000000000000000000" results in "66e94bd4ef8a2c3b884cfa59ca342b2e0143db63ee66b0cdff9f69917680151e".

Expected output was "66e94bd4ef8a2c3b884cfa59ca342b2e". But the output was "66e94bd4ef8a2c3b884cfa59ca342b2e" + "0143db63ee66b0cdff9f69917680151e". It can be confirmed that "0143db63ee66b0cdff9f69917680151e" is the cipher text of a null string.

Recipe 2

Most helpful comment

Many thanks. Padding mode should be changeable then.

All 2 comments

This doesn't appear to be a bug. Forge, the crypto library used by this operation, explicitly states that "CBC and ECB modes use PKCS#7 padding as default" which is typical for these operation modes. It can be seen that 0143db63ee66b0cdff9f69917680151e is the cipher text of a full padding block of 0x10 bytes: recipe

It might be useful though if these operations included the option to disable padding.

Many thanks. Padding mode should be changeable then.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Perflyst picture Perflyst  路  4Comments

Oliboy50 picture Oliboy50  路  4Comments

twilight-sparkle-irl picture twilight-sparkle-irl  路  4Comments

n1474335 picture n1474335  路  3Comments

n1474335 picture n1474335  路  5Comments