poly-crypto
Version:
High-level cryptographic functions that are interoperable between NodeJS and PHP 7.1+.
14 lines (11 loc) • 337 B
JavaScript
const { PolyAES } = require('../dist/index.cjs');
try {
const [, , password, salt, ciphertext] = process.argv;
const cipher = PolyAES.withPassword(password, salt);
const encrypted = cipher.encrypt(ciphertext);
process.stdout.write(encrypted);
} catch (e) {
process.stderr.write(e.message);
process.exit(1);
}