Simple AES-less encryption via node.
With the EncryptionKey class:
const {
GenerateSecureKey,
EncryptionKey
} = require("passenc");
const password = GenerateSecureKey(256);
const key = new EncryptionKey(password);
const text = "origin";
const encrypted = key.encrypt(text);
const decrypted = key.decrypt(encrypted);
console.assert(decrypted === text);
With the encrypt & decrypt functions:
const { encrypt, decrypt } = require("passenc");
const key = "normal password works too";
const text = "origin";
const encrypted = encrypt(text, key);
const decrypted = decrypt(encrypted, key);
console.assert(decrypted === text)