gchq/CyberChef

Feature request: Embed within a JSON object (reverse JPath)

tim-hitchins-ekkosense opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
I have a pipeline which is

  1. Extract a string from a JSON object with the JPath operation
  2. Decode the string as Base64
  3. Inflate the binary data with ZLIB inflate

This recipe can be found here

But I'd like to do the reverse

  1. Deflate a string with ZLIB deflate
  2. Encode that binary data as Base64
  3. Embed that string within a JSON object

That last step is not possible right now

Describe the solution you'd like
I would like a step which can take the previous step's output string, and embed it within a provided JSON object. For example, the step's input could be

{"data": $1}

and it would substitute the $1 for the step input

Describe alternatives you've considered

A workaround is to manually embed the string within the JSON parts {"data":" and "} via find and replace:

https://cyberchef.io/#recipe=Zlib_Deflate('Dynamic%20Huffman%20Coding')To_Base64('A-Za-z0-9%2B/%3D')Find_/_Replace(%7B'option':'Regex','string':'%5E'%7D,'%7B%22data%22:%22',true,false,false,false)Find_/_Replace(%7B'option':'Regex','string':'$'%7D,'%22%7D',true,false,true,false)&input=Q3liZXJDaGVm

Additional context