-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Character encoding, EOL separators, and editor features
CyberChef v10 introduces a range of new features to the Input and Output panes:
- Status bars, showing statistics and options related to the data
- Character encoding selection to explicitly determine how Input data should be encoded and Output data decoded
- End of Line separator selection to improve data integrity
- Non-printable character rendering to ensure you always know exactly what you are working with
- Improved file loading, allowing you to edit any file you load into the tool
- A range of modern editor features such as rectangular selections, bracket matching, and selection matching
In addition, a new contextual help feature has been added, activated by pressing F1
while hovering over a feature that you would like to learn more about.
Both the Input and Output now have status bars showing information about their data such as the total length, number of lines, current selection, character encoding and EOL separator.
You can now explicitly set which character encoding you would like your Input to be encoded with before it is processed by the Recipe. You can also select how the Output should be decoded once the Recipe has returned. The default value is 'Raw bytes' which attempts to treat every character as a byte in the range 0-255. If one of the characters has a Unicode value greater than 255, CyberChef will default to using UTF-8. This is the behaviour of CyberChef 9 and below, so it should be suitable for most cases, particularly if working with binary file data.
EOL characters can now be set, with the default being the line feed character (\n
). When data is pasted into CyberChef that contains a different EOL separator, its original value will be preserved. It will show up as a control character picture, as explained below.
Any characters not in the printable range are now rendered as control character pictures in red. This is important for data integrity as it is much clearer which characters are present. It also makes it easier to copy and paste binary data, for example that which has been compressed or encrypted, or the contents of binary files.
A good example of where this is helpful is if you copy multiple lines from a Windows application like Notepad or Microsoft Word into CyberChef. If your EOL separator is set to LF
(\n
), you will see Carriage Return control codes at the end of each line when the data is pasted in. This is because the EOL separator in Windows applications is CR+LF
(\r\n
) and CyberChef is set to render only LF
characters as EOL separators, leaving the CR
character surplus. In a tool like CyberChef it is important that we don't automatically convert these characters as we may require them to get an accurate hash of the data, decrypt it correctly, or convert it to a different format. Setting the EOL separator to CRLF
will hide these surplus characters as both the CR
and LF
are used to denote the end of the line together.
Due to the changes in how non-printable characters are rendered, loaded files can now be edited in the Input as their bytes can be represented accurately. A side panel will be shown listing the file metadata along with a thumbnail preview if the file is an image (this thumbnail can be turned off in the Options pane).
Various modern code editor features have been added to CyberChef's Input and Output, thanks to the use of the excellent CodeMirror6 editor. These include rectangular selections and multiple selections, allowing you to copy, delete, or edit multiple parts of the Input at once.
Bracket matching has also been added, along with selection matching which highlights other instances of the same word or phrase elsewhere in the Input or Output. If the operations in the current Recipe support it, the corresponding selections will be shown in the Output or Input respectively.
Taking a leaf out of Ghidra's book, I have implemented a contextual help feature. This is accessed by pressing F1
while hovering the mouse over a feature that you want to learn more about.
I had always intended CyberChef to be as self-explanatory as possible, requiring no training to understand the tool itself or how to use it. That is not to say that training is not required to learn how to get the most out of it, or to understand how some of the Operations work, but the tool itself and the methods by which you use it should be fairly obvious. This release has the potential to break that paradigm due to the introduction of more complex features with the occasional nuance as explained above. Contextual help has been added to explain some of these nuances, but I am open to suggestions for improvements. I think that the benefits they provide are worth the added complexity. As the Zen of Python says, "Simple is better than complex. Complex is better than complicated."
- n1474335, 21st March 2023