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 cpass
Usage
JavaScript
constCpass=require('cpass').Cpass;constcpass=newCpass();constpassword='password';constsecured=cpass.encode(password);// secured: "40bbb043608f54d....MhKghXTcaR2A//yNXg==" // is unique on different machinesconstunsecured=cpass.decode(secured);// unsecured: 'password'
TypeScript
import { Cpass } from'cpass';constcpass=newCpass();constpassword='password';constsecured=cpass.encode(password);// secured: "40bbb043608f54d....MhKghXTcaR2A//yNXg=="// is unique on different machinesconstunsecured=cpass.decode(secured);// unsecured: 'password'