Use this robust n8n workflow template to securely encrypt and decrypt sensitive data within your automation pipelines using XOR logic and Base64 encoding. Ideal for secure data handling via a dedicated n8n node.
Download this n8n workflow template and start using it instantly.
Technical Users and Developers: Individuals needing custom security layers for data passed between different n8n workflows or systems.
Security-Conscious Automators: Users looking to handle sensitive keys or payloads securely within their n8n environment.
Security often requires custom solutions, especially when dealing with proprietary or sensitive data in automation pipelines. This n8n workflow provides a dedicated, reusable service for XOR encryption and decryption, augmented with Base64 encoding to handle binary data safely across JSON payloads.
Instead of building complex crypto logic into every automation, you can call this modular n8n template using the 'Execute Workflow' n8n node. This approach centralizes sensitive logic, making your main n8n workflow cleaner and easier to maintain. This specific n8n workflow leverages JavaScript code nodes to perform the cryptographic operations, ensuring a strong, consistent implementation every time it is activated by the n8n trigger.
This n8n workflow operates entirely as a sub-routine, initiated by an external n8n node calling its internal trigger.
action-type (either 'encrypt' or 'decrypt'), key (the XOR encryption key), and data (the payload to be processed).action-type field. If the value strictly equals 'encrypt', the flow proceeds down the true path.action-type is anything other than 'encrypt' (implicitly 'decrypt' in a well-structured call), the flow proceeds down the false path. The decrypt Code n8n node executes. It first decodes the Base64 input and then applies the XOR decryption using the provided key, returning the original, plaintext data to the calling n8n workflow.To utilize this security-focused n8n template, follow these steps:
action-type, key, and data in the input mapping. When Executed by Another Workflow (n8n Trigger):
Function: Serves as the callable n8n trigger, allowing this modular n8n workflow to be run by other processes.
Key Configuration: Expects workflow inputs for action-type, key, and data.
If (n8n Node):
Function: Routes the execution path based on whether the input requires encryption or decryption.
Key Configuration: Checks if {{ $json['action-type'] }} equals 'encrypt'.
encrypt (Code n8n Node):
Function: Performs XOR encryption followed by Base64 encoding. This custom n8n node securely processes the payload.
Key Configuration: Contains a custom JavaScript function xorEncrypt that reads the data and key from the incoming payload and returns the Base64-encoded encrypted result.
decrypt (Code n8n Node):
Function: Performs Base64 decoding followed by XOR decryption. This powerful n8n node reverses the cryptographic process.
Key Configuration: Contains a custom JavaScript function xorDecrypt that reads the encrypted Base64 data and the shared key to return the original plaintext data.
Automate complex data migration using this n8n workflow. Read local XML files, convert them to JSON, and import structured records directly into MySQL using a series of powerful n8n node steps.

Automate brand monitoring on X/Twitter using a powerful n8n workflow. Scrape tweets, analyze sentiment with Google Gemini AI agents, save results to Google Sheets, and dispatch urgent alerts to Slack.

Deploy this powerful n8n workflow to automatically monitor daily tech trends on X (Twitter) and Reddit using a Gemini AI Agent. Generate structured reports in Notion and receive immediate summaries via Telegram. This is a highly efficient n8n template for market intelligence.

Automate custom Yelp data extraction using this robust n8n workflow. It uses a form as an n8n trigger, initiates scraping via Bright Data, and reliably stores structured business information into Google Sheets.


I'm a software developer with over 11 years of experience building systems across various stacks. I'm now applying that expertise to create practical and scalable workflow automations with n8n — focusing on clean logic, real-world use cases, and reusability. Always open to learning, sharing, and collaborating.







































