Skip to content

Instantly share code, notes, and snippets.

@krkeegan
krkeegan / show-creds.js
Created February 19, 2026 19:42 — forked from hardillb/show-creds.js
Quick script to decrypt Node-RED credentials files
const crypto = require('crypto');
var encryptionAlgorithm = "aes-256-ctr";
function decryptCreds(key, cipher) {
var flows = cipher["$"];
var initVector = Buffer.from(flows.substring(0, 32),'hex');
flows = flows.substring(32);
var decipher = crypto.createDecipheriv(encryptionAlgorithm, key, initVector);
var decrypted = decipher.update(flows, 'base64', 'utf8') + decipher.final('utf8');