Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tim-hitchins-ekkosense opened this issue May 30, 2024 · 0 comments
Open
Labels

Comments

@tim-hitchins-ekkosense
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant