How to do XOR image decryption webp?

Describe the problem/error/question

I want to decrypt webp images that were encrypted with XOR. I found a template here XOR Encryption and Decryption with Base64 Encoding for Workflow Data | n8n workflow template and I tried to adapt it for my needs. My workflow downloads images and when it attempts to decrypt it gives an error. I’m not a experienced programmer, does anyone know how to fix this?

What is the error message (if any)?

The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Object [line 2]

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.98.2
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Windows Server 2022

Hey Ruriko,

You’re very close! In this case, you needed to

  1. use “Extract from file” node to get the base64 of the image. n8n has migrated to using filesystem as the default for binary data so “$binary” will give you “filesystem-v2” rather than actual binary content.
  2. Close the loop by attached the outgoing of the code node back to the incoming of the “loop over items”. This ensures your workflow continues after the first page.
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.