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