senc
js-senc - js implementation ofLibrary
WARNING: Library uses pull-streams.
Works in node.js and the browser. Uses libp2p-crypto.
Install
npm install --save senc
Encrypt
var senc = var stdio = var key = senc
Decrypt
var senc = var stdio = var key = <key-from-above>
Random Key
var senc = console
Command Line
Install
npm install --global senc
Usage
usage: senc -e -k <key> - encrypt stdin with aes senc -d -k <key> - decrypt stdin with aes OPTIONS -h, --help this help text -d set decrypt mode -e set encrypt mode -k <string> key to use -b <base> the multibase encoding to write key to --key-gen generate a key
Key-gen
> senc --key-genzEkHKdVKVUazjMndot4puCyA57Ji7vH6VhemsNk8vvkhi > key=$(senc --key-gen)
Encrypt
senc -k zEkHKdVKVUazjMndot4puCyA57Ji7vH6VhemsNk8vvkhi -e <plaintext >ciphertext
Decrypt
senc -k zEkHKdVKVUazjMndot4puCyA57Ji7vH6VhemsNk8vvkhi -d <ciphertext >plaintext2
Full Example
# keygen senckey=$(senc --key-gen) # encrypt senc -k $senckey -e <plaintext >ciphertext # decrypt senc -k $senckey -d <ciphertext >plaintext2 # check the diff diff plaintext plaintext2