gchq / gchq/CyberChef

Bug report: <Insert title here>

Open
#1,521 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
35.9k
Forks
4.2k
Avg merge
2d 9h
Merged PRs (30d)
33

Description

**Describe the bug**
Use of ToHex in Data Format provides results that differ from other web sites and libraries

**To Reproduce**
1. From "Data Format", drag "ToHex" to the Recipe panel
2. Type in "ein deutscher Text über Großbritannien", without the quotes
3. Result is "65 69 6e 20 64 65 75 74 73 63 68 65 72 20 54 65 78 74 20 fc 62 65 72 20 47 72 6f df 62 72 69 74 61 6e 6e 69 65 6e", without the quotes
4. Using https://cryptii.com/pipes/text-to-binary, we get "65 69 6e 20 64 65 75 74 73 63 68 65 72 20 54 65 78 74 20 c3 bc 62 65 72 20 47 72 6f c3 9f 62 72 69 74 61 6e 6e 69 65 6e"
5. Using https://onlineunicodetools.com/convert-unicode-to-bytes, we also get "65 69 6e 20 64 65 75 74 73 63 68 65 72 20 54 65 78 74 20 c3 bc 62 65 72 20 47 72 6f c3 9f 62 72 69 74 61 6e 6e 69 65 6e" with "Skip Spaces" unchecked
6. Using M$FT and Delphi TEncode libs, we also get the same results as from the web sites

**Expected behaviour**
To sum up, we get this with CyberChef:
65 69 6e 20 64 65 75 74 73 63 68 65 72 20 54 65 78 74 20 __fc__ 62 65 72 20 47 72 6f __df__ 62 72 69 74 61 6e 6e 69 65 6e
and that with all other tools
65 69 6e 20 64 65 75 74 73 63 68 65 72 20 54 65 78 74 20 __c3__bc__ 62 65 72 20 47 72 6f __c3__9f__ 62 72 69 74 61 6e 6e 69 65 6e

Question: which one is correct? A majority vote says NOT CyberChef but a bug in a library used by all others would lead to an opposite conclusion. However, it is unlikely that all others use the same library as we can expect JS, Java, C and Pascal implementations to be used.

**Screenshots**
No screenshot needed.

**Desktop (if relevant, please complete the following information):**
- CyberChef * Version: 9.55.0, Compile time: 09/12/2022 11:42:13 UTC

**Additional context**
NA

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported input in the Data Format ToHex operation and compare its output with the byte sequences listed from the other tools. Determine which encoding behavior CyberChef intends to provide, then verify the result against the reported version and expected output. Done means the discrepancy is explained and the operation's behavior is corrected or confirmed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.