{
  "workflow": {
    "id": 5733,
    "name": "Secure user emails with AES-256 encryption and verification system",
    "views": 143,
    "recentViews": 0,
    "totalViews": 143,
    "createdAt": "2025-07-07T04:26:25.713Z",
    "description": "# 🔐 Email Encryption Masterclass\n*Professional-Grade AES-256 Data Protection for n8n*\n\n## How It Works\n\nThis comprehensive workflow demonstrates enterprise-level email encryption using industry-standard AES-256-CBC encryption. Perfect for organizations handling sensitive customer data who need to comply with GDPR, HIPAA, or other data protection regulations.\n\n**The workflow processes data in three secure stages:**\n\n1. **Sample Data Generation** - Creates test user records with emails for demonstration\n2. **Email Encryption** - Applies AES-256-CBC encryption with unique initialization vectors (IVs) for each record\n3. **Verification System** - Decrypts and validates the encrypted data to ensure integrity\n\nEach email address is encrypted with a randomly generated IV, making every encryption unique even for identical email addresses. The system includes comprehensive error handling and provides detailed processing status for audit trails.\n\n## Key Features\n\n✅ **Military-Grade Security**: AES-256-CBC encryption with unique IVs\n✅ **Compliance Ready**: Built for GDPR, HIPAA, and SOX requirements  \n✅ **Batch Processing**: Handles large datasets efficiently\n✅ **Error Handling**: Graceful failure management with detailed logging\n✅ **Verification System**: Built-in decryption validation\n✅ **Audit Trail**: Complete processing timestamps and status tracking\n✅ **Production Ready**: Includes security best practices and key management guidance\n\n## Setup Steps\n\n### 1. Import the Workflow\n- Download the JSON file\n- In n8n, go to **Workflows** → **Import from File**\n- Select the downloaded JSON file\n- Click **Import**\n\n### 2. Configure Security Settings\n- Open the **Encrypt Emails** node\n- Replace the default secret key with your own 32-character secure key:\n  ```javascript\n  const secret = 'your_32_character_secret_key_here!';\n  ```\n- **Important**: In production, use environment variables for the secret key\n\n### 3. Set Up Sample Data (Optional)\n- The workflow includes sample user data for testing\n- Replace with your actual data source (database, API, CSV, etc.)\n- Ensure your data has an `email` field\n\n### 4. Test the Workflow\n- Click **Execute workflow** to run the complete process\n- Review the encrypted results in each node\n- Verify that emails are properly encrypted and can be decrypted\n\n### 5. Production Deployment\n- **Remove** the `originalEmail` field from output (line 45 in Encrypt Emails node)\n- Store your secret key in environment variables\n- Set up proper key rotation schedule\n- Configure monitoring and alerting for failed encryptions\n\n## Security Best Practices Included\n\n🔒 **Unique IVs**: Every encryption uses a fresh random initialization vector\n🔒 **Proper Key Length**: Enforces 32-byte keys for AES-256\n🔒 **Error Isolation**: Failed encryptions don't break the entire batch\n🔒 **No Key Exposure**: Secret keys are never logged or stored in output\n🔒 **Verification Loop**: Ensures encrypted data can be successfully decrypted\n\n## Use Cases\n\n- **Customer Data Protection**: Encrypt email addresses in CRM systems\n- **Compliance Requirements**: Meet GDPR, HIPAA, SOX data protection mandates\n- **Data Warehouse Security**: Protect PII in analytics databases\n- **Secure Data Transfer**: Encrypt sensitive data before API transmission\n- **Audit Preparation**: Demonstrate proper data protection controls\n\n\n\n---\n\n*This workflow represents years of cybersecurity expertise condensed into a ready-to-use automation solution. Perfect for developers, security professionals, and compliance teams who need reliable data encryption.*",
    "workflow": {
      "id": "TubhBU7sNJM8HbIO",
      "meta": {
        "instanceId": "2000c64071c20843606b95c63795bb0797c41036047055a6586498e855b96efc"
      },
      "name": "🔐 Email Encryption Masterclass",
      "tags": [],
      "nodes": [
        {
          "id": "2dffdac7-13c1-4341-a122-4f9b049da158",
          "name": "When clicking \"Test workflow\"",
          "type": "n8n-nodes-base.manualTrigger",
          "position": [
            220,
            0
          ],
          "parameters": {},
          "typeVersion": 1
        },
        {
          "id": "ecdf641b-33f0-46a4-98f0-8bd8cce5b603",
          "name": "Sample Data",
          "type": "n8n-nodes-base.code",
          "position": [
            420,
            0
          ],
          "parameters": {},
          "typeVersion": 2
        },
        {
          "id": "a07a7590-8424-4fa6-b518-cbb65c7803ff",
          "name": "Encrypt Emails",
          "type": "n8n-nodes-base.code",
          "position": [
            620,
            0
          ],
          "parameters": {},
          "typeVersion": 2
        },
        {
          "id": "44f1e649-428a-48b4-bba5-49e1618b177c",
          "name": "Verify Encryption",
          "type": "n8n-nodes-base.code",
          "position": [
            820,
            0
          ],
          "parameters": {},
          "typeVersion": 2
        },
        {
          "id": "892d4560-b558-4888-ad87-57503ceafe54",
          "name": "Sticky Note",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -220,
            -100
          ],
          "parameters": {
            "content": ""
          },
          "typeVersion": 1
        },
        {
          "id": "c95888de-7c36-47fd-8a3c-177349302ec2",
          "name": "Sticky Note1",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -220,
            280
          ],
          "parameters": {
            "content": ""
          },
          "typeVersion": 1
        }
      ],
      "active": false,
      "pinData": {},
      "settings": {
        "executionOrder": "v1"
      },
      "versionId": "6b1a2fe4-908c-4703-a59c-0ab1e80cf620",
      "connections": {
        "Sample Data": {
          "main": [
            [
              {
                "node": "Encrypt Emails",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Encrypt Emails": {
          "main": [
            [
              {
                "node": "Verify Encryption",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "When clicking \"Test workflow\"": {
          "main": [
            [
              {
                "node": "Sample Data",
                "type": "main",
                "index": 0
              }
            ]
          ]
        }
      }
    },
    "lastUpdatedBy": 29,
    "workflowInfo": {
      "nodeCount": 6,
      "nodeTypes": {
        "n8n-nodes-base.code": {
          "count": 3
        },
        "n8n-nodes-base.stickyNote": {
          "count": 2
        },
        "n8n-nodes-base.manualTrigger": {
          "count": 1
        }
      }
    },
    "status": "published",
    "user": {
      "name": "David Olusola",
      "username": "dae221",
      "bio": "I design enterprise-grade automation systems that eliminate bottlenecks, cut manual work by 70%+, and unlock millions in lost revenue opportunities. My clients — typically achieve 5–10x ROI within the first 90 days. Currently partnering with select high-growth companies ready to scale faster with AI automation.  david@daexai.com",
      "verified": true,
      "links": [
        ""
      ],
      "avatar": "https://gravatar.com/avatar/2abbc4c9e828c54a8d8838beda1382e8e4a66684ef9fa8451dbeb3e72b0c9f9c?r=pg&d=retro&size=200"
    },
    "nodes": [
      {
        "id": 565,
        "icon": "fa:sticky-note",
        "name": "n8n-nodes-base.stickyNote",
        "codex": {
          "data": {
            "alias": [
              "Comments",
              "Notes",
              "Sticky"
            ],
            "categories": [
              "Core Nodes"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0",
            "subcategories": {
              "Core Nodes": [
                "Helpers"
              ]
            }
          }
        },
        "group": "[\"input\"]",
        "defaults": {
          "name": "Sticky Note",
          "color": "#FFD233"
        },
        "iconData": {
          "icon": "sticky-note",
          "type": "icon"
        },
        "displayName": "Sticky Note",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          }
        ]
      },
      {
        "id": 834,
        "icon": "file:code.svg",
        "name": "n8n-nodes-base.code",
        "codex": {
          "data": {
            "alias": [
              "cpde",
              "Javascript",
              "JS",
              "Python",
              "Script",
              "Custom Code",
              "Function"
            ],
            "details": "The Code node allows you to execute JavaScript in your workflow.",
            "resources": {
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code/"
                }
              ]
            },
            "categories": [
              "Development",
              "Core Nodes"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0",
            "subcategories": {
              "Core Nodes": [
                "Helpers",
                "Data Transformation"
              ]
            }
          }
        },
        "group": "[\"transform\"]",
        "defaults": {
          "name": "Code"
        },
        "iconData": {
          "type": "file",
          "fileBuffer": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8xMTcxXzQ0MSkiPgo8cGF0aCBkPSJNMTcwLjI4MyA0OEgxOTYuNUMyMDMuMTI3IDQ4IDIwOC41IDQyLjYyNzQgMjA4LjUgMzZWMTJDMjA4LjUgNS4zNzI1OCAyMDMuMTI3IDAgMTk2LjUgMEgxNzAuMjgzQzEyNi4xIDAgOTAuMjg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c0Ljk3OCAzMzZWNDMyQzM3NC45NzggNDQ5LjY3MyAzNjAuNjUyIDQ2NCAzNDIuOTc5IDQ2NEgzMTdDMzEwLjM3MyA0NjQgMzA1IDQ2OS4zNzMgMzA1IDQ3NlY1MDBDMzA1IDUwNi42MjcgMzEwLjM3MyA1MTIgMzE3IDUxMkgzNDIuOTc5QzM4Ny4xNjEgNTEyIDQyMi45NzggNDc2LjE4MyA0MjIuOTc4IDQzMlYzMzZDNDIyLjk3OCAzMDUuMDcyIDQ0OC4wNTEgMjgwIDQ3OC45NzkgMjgwSDQ5MEM0OTYuNjI3IDI4MCA1MDIgMjc0LjYyOCA1MDIgMjY4VjI0NEM1MDIgMjM3LjM3MyA0OTYuNjI4IDIzMiA0OTAgMjMyTDQ3OC45NzkgMjMyQzQ0OC4wNTEgMjMyIDQyMi45NzggMjA2LjkyOCA0MjIuOTc4IDE3NlY4MEM0MjIuOTc4IDM1LjgxNzIgMzg3LjE2MSAwIDM0Mi45NzkgMEgzMTdDMzEwLjM3MyAwIDMwNSA1LjM3MjU4IDMwNSAxMlYzNloiIGZpbGw9IiNGRjk5MjIiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xMTcxXzQ0MSI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo="
        },
        "displayName": "Code",
        "typeVersion": 2,
        "nodeCategories": [
          {
            "id": 5,
            "name": "Development"
          },
          {
            "id": 9,
            "name": "Core Nodes"
          }
        ]
      },
      {
        "id": 838,
        "icon": "fa:mouse-pointer",
        "name": "n8n-nodes-base.manualTrigger",
        "codex": {
          "data": {
            "resources": {
              "generic": [],
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.manualworkflowtrigger/"
                }
              ]
            },
            "categories": [
              "Core Nodes"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0"
          }
        },
        "group": "[\"trigger\"]",
        "defaults": {
          "name": "When clicking ‘Execute workflow’",
          "color": "#909298"
        },
        "iconData": {
          "icon": "mouse-pointer",
          "type": "icon"
        },
        "displayName": "Manual Trigger",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          }
        ]
      }
    ],
    "categories": [
      {
        "id": 29,
        "name": "SecOps"
      }
    ],
    "image": []
  }
}