npm install -g cifra
➜ ~ cifra -h
Usage: cifra [options] [command]
Encrypt and decrypt files with node
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
Encrypt|e <file> <password> [algorithm] Encript file
Decrypt|d <file> <password> [algorithm] Decrypt file
On recent OpenSSL releases, openssl list-cipher-algorithms
will display the available cipher algorithms.
const encrypt = require('cifra').Encrypt;
const decrypt = require('cifra').Decrypt;
// Use with await
async function encryptAndDecryptExample() {
await encrypt.file('./arg.js', 'mafasd');
await decrypt.file('./arg.js.enc','mafasd');
}
encryptAndDecryptExample();
// Return promise
encrypt.file('./arg.js', 'mafasd')
.then(() => {
decrypt.file('./arg.js.enc','mafasd');
});