UNPKG

poly-crypto

Version:

High-level cryptographic functions that are interoperable between NodeJS and PHP 7.1+.

14 lines (11 loc) 337 B
#!/usr/bin/env node 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); }