Cyberchef: Bug report: 0D (binary) is silently replaced with 0A (binary)

Created on 21 Nov 2018  路  3Comments  路  Source: gchq/CyberChef

Hello,

0D (binary) in the input box is silently replaced with 0A (binary) in the output box.
And 0D 0A (binary) sequence is also replaced with 0A (binary).
These replacements break data integrity.
If input data is a dragged and dropped file, the replacements does not occur.

How to reproduce



  1. Input "0D 0D 41 0D 0A" (text, without quotes) in the input box.
  2. Use "From Hex" recipe. Data in the output box is "0D 0D 41 0D 0A" (binary). This output is correct.
  3. Press "Move output to input" button.
  4. Change the recipe to "To Hex". Data in the output box should be "0d 0d 41 0d 0a" (text),
    but it is actually "0a 0a 41 0a" (text). This output is corrupted.

Tested version

CyberChef at https://gchq.github.io/CyberChef/

Tested browsers

Mozilla Firefox, Google Chrome and Microsoft Edge on Windows 10 (the same behavior with all three browsers)

knownbug

All 3 comments

This is a "feature" of HTML textarea elements and there is nothing we can do about it without writing a custom DOM element.

This is one of the reasons why files are loaded in the way that they are - to preserve carriage return bytes.

If someone has a solution, I'd be glad to hear it.

Oh, it is because of a feature of HTML textarea elements. I understand that it is very hard to resolve.
Thank you very much for your explanation.

No problem, thanks for the detailed bug report. I'll close this issue now as we have no immediate plans to fix this. However, if someone has a suggested solution, please feel free to reopen it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

n1474335 picture n1474335  路  6Comments

farewell-ladmin picture farewell-ladmin  路  3Comments

wumb0 picture wumb0  路  3Comments

themacguffinman picture themacguffinman  路  4Comments

n1474335 picture n1474335  路  5Comments