Crypto-Blue: Cipher Node

image

The Cipher node uses the AES algorithm for encrypting and decrypting message payloads. The following properties can be configured for the node:

  • Function: The node's functions, choices include:

    • Encrypt
    • Decrypt
  • Algorithm: The algorithm mode to use in the node, the options included are the following: AES-CBC, AES-ECB, AES-CFB, AES-OFB, AES-CTR, AES-GCM

  • IV (string): The initialization vector to use, must be in hex format. This can also be configured through the msg.iv field of an injected message.

  • IV Size: The size of the initialization vector, options include 128 bit, 192 bit and 256 bit.

  • Key (string): The key to use for the encryption / decryption process, must be in hex format. This can also be configured through the msg.key field of an injected message.

  • Key Size: The size of the key, options include 128 bit, 192 bit and 256 bit.

[{"id":"17948feedf2ac783","type":"inject","z":"d4703d9e2676369d","name":"Cipher Injector","props":[{"p":"password","v":"S3cr3tPassword","vt":"str"},{"p":"plaintext","v":"Hello World","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":180,"y":560,"wires":[["bff69d8ca91a3429"]]},{"id":"b34b1dd96cbf8cb1","type":"cipher","z":"d4703d9e2676369d","name":"","function":"Encrypt","algorithm":"AES-CBC","iv":"","key":"","ivSize":"16","keySize":"16","x":600,"y":620,"wires":[["90379e0896fbed91","fd87104e97589bfa"]]},{"id":"bff69d8ca91a3429","type":"pkdf","z":"d4703d9e2676369d","name":"Generate Encryption Key","keySize":"16","iterations":"10","salt":"","saltSize":"16","password":"","x":410,"y":560,"wires":[["adca33df436fee27"]]},{"id":"adca33df436fee27","type":"change","z":"d4703d9e2676369d","name":"Set Key and Plaintext","rules":[{"t":"move","p":"payload.key","pt":"msg","to":"key","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"plaintext","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":620,"wires":[["b34b1dd96cbf8cb1"]]},{"id":"90379e0896fbed91","type":"debug","z":"d4703d9e2676369d","name":"Print Payload Result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":860,"y":640,"wires":[]},{"id":"fd87104e97589bfa","type":"change","z":"d4703d9e2676369d","name":"Set IV and Encrypted","rules":[{"t":"move","p":"payload.iv","pt":"msg","to":"iv","tot":"msg"},{"t":"move","p":"payload.encrypted","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":680,"wires":[["c56a1c73d74e0b1b"]]},{"id":"c56a1c73d74e0b1b","type":"cipher","z":"d4703d9e2676369d","name":"","function":"Decrypt","algorithm":"AES-CBC","iv":"","key":"","ivSize":"16","keySize":"16","x":600,"y":680,"wires":[["90379e0896fbed91"]]}]

Flow Info

Created 2 years, 5 months ago
Rating:

Owner

Actions

Rate:

Node Types

Core
  • change (x2)
  • debug (x1)
  • inject (x1)
Other

Tags

  • node-red
  • crypto-blue
  • blue-sec
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option