cpass
π Simple secure string password convertor
Encrypts password to some sort of a 'secure string' to be stored in text configs to reduce risks of a silly leak.
Decripts a 'secure string' to plain password.
Installation
npm install cpassUsage
JavaScript
const Cpass = require('cpass').Cpass;
const cpass = new Cpass();
const password = 'password';
const secured = cpass.encode(password);
// secured: "40bbb043608f54d....MhKghXTcaR2A//yNXg=="
// is unique on different machines
const unsecured = cpass.decode(secured);
// unsecured: 'password'TypeScript
Decoding plain text will return it back:
Encryption with master key
Tests
Local run
Run in Docker for specific Node.js version
Comments
This module is not for a real security purposes. Just for 'dummy hackers' secure and minifying risks of any password storage in a plain form.
Once encoded, the password secured form can be decoded only on the same machine, but the logic behind this is very straightforward.
Last updated
Was this helpful?