Conversation
Collaborator
|
This is a great solution, should reduce the number of people freaking out whenever I post a link to the app as a solution to a puzzle! |
Contributor
|
This is a good change, I have got some pushback in the past for suspicious looking URLs so this is a welcome change. I'm glad you have maintained backwards compatibility with JSON recipe links, very nice work. |
BRAVO68WEB
pushed a commit
to BRAVO68WEB/CyberChef
that referenced
this pull request
May 29, 2022
[REFACTOR] - Style improvments
This was referenced Sep 26, 2022
This was referenced Oct 6, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds a new 'pretty' recipe configuration format so that URLs are slightly more readable.
The current recipe format is simply serialised JSON. A contrived example with three random operations looks like this:
[ { "op": "From Hex", "args": ["Space"] }, { "op": "Pad lines", "args": ["Start", 5, " "] }, { "op": "Strings", "args": [3, false] } ]When added to the URL, this has to be percent-encoded and ends up as this mess:
#recipe=%5B%7B%22op%22%3A%22From%20Hex%22%2C%22args%22%3A%5B%22Space%22%5D%7D%2C%7B%22op%22%3A%22Pad%20lines%22%2C%22args%22%3A%5B%22Start%22%2C%225%22%2C%22%20%22%5D%7D%2C%7B%22op%22%3A%22Strings%22%2C%22args%22%3A%5B%223%22%2Cfalse%5D%7D%5DNeedless to say, this isn't particularly readable. The new format attempts to be as compact as possible, whilst improving readability. It relies on various special characters that do not need to be escaped in the fragment (#) or query (?) parts of a URL, as defined in RFC 3986. The above example looks like this in the new format:
When it is used in the URL, newlines are removed and only characters which need to be escaped are percent-encoded:
This saves space and hopefully looks a little less confusing. Complex CyberChef recipes can now be shared without the link looking quite as much like an XSS attempt...
Backwards compatibility with the serialised JSON recipe format has been maintained so old links will still work.