poly-crypto
Version:
High-level cryptographic functions that are interoperable between NodeJS and PHP 7.1+.
15 lines (12 loc) • 356 B
JavaScript
import { PolyAES } from '../dist/index.cjs';
try {
// usage: npx poly-aes decrypt <key> <ciphertext>
const [, , key, ciphertext] = process.argv;
const cipher = PolyAES.withKey(key);
const plaintext = cipher.decrypt(ciphertext);
process.stdout.write(plaintext);
} catch (e) {
process.stderr.write(e.message);
process.exit(1);
}