Meeco Encryption Library CLI
You can install this package in 3 different ways:
- Use installers for MacOS or Windows from the releases page. You don't need to have Node on your system to run Cryppo, the package already contains Node.
- Use tarballs with prebuilt packages for you OS and hardware platform from releases page.You don't need to have Node on your system to run Cryppo, the package already contains Node.
- As a regular NPM package. You need to have Node on your system to run it
- Download an installer for your OS and your platform from the releases page.
For example, for MacOS on Apple Silicon the installer might look like
cryppo-v2.1.0-78d2298-arm64.pkg
- Double-click on the installer and follow instruction
- Open a terminal. The
cryppo
command should be in the path. Check it by runningcryppo
orcryppo genkey
- Download a gzip file appriate for your system from the releases page.
For example, for MacOS on Apple Silicon the installer might look like
cryppo-v2.1.0-413e854-linux-arm64.tar.gz
- Unzip the file:
tar xvfz cryppo-v2.1.0-413e854-linux-arm64.tar.gz
- Change to directory with Cryppo
cd ./cryppo
- Test by running
./bin/cryppo genkey
or./bin/cryppo
- Make sure you have
node
andyarn
installed - Clone Cryppo-CLI:
git clone https://github.com/Meeco/cryppo-cli.git
cd cryppo-cli
- Install dependencies:
yarn install
- Build the project:
yarn run build
- Test by running
./bin/cryppo genkey
or./bin/cryppo
$ cryppo genkey
vm8CjugMda2zdjsI9W25nH-CY-84DDYoBxTFLwfKLDk=
$ cryppo encrypt -v "hello world" -k vm8CjugMda2zdjsI9W25nH-CY-84DDYoBxTFLwfKLDk=
Aes256Gcm.gSAByGMq4edzM0U=.LS0tCml2OiAhYmluYXJ5IHwtCiAgaW1QL09qMWZ6eWw0cmwwSgphdDogIWJpbmFyeSB8LQogIE5SbjZUQXJ2bitNS1Z5M0FpZEpmWlE9PQphZDogbm9uZQo=
$ cryppo decrypt -s "Aes256Gcm.gSAByGMq4edzM0U=.LS0tCml2OiAhYmluYXJ5IHwtCiAgaW1QL09qMWZ6eWw0cmwwSgphdDogIWJpbmFyeSB8LQogIE5SbjZUQXJ2bitNS1Z5M0FpZEpmWlE9PQphZDogbm9uZQo=" -k vm8CjugMda2zdjsI9W25nH-CY-84DDYoBxTFLwfKLDk=
hello world
RSA
$ cryppo genkeypair -p private.pem -P public.pem
$ cryppo encrypt -v "hello world" -P public.pem
$ cryppo decrypt -s <result of previous command> -p private.pem
$ cryppo sign -p private.pem myfile.txt myfile.signed.txt
$ cryppo verify -P public.pem myfile.signed.txt myfile.txt
$ npm install -g cryppo-cli
$ cryppo COMMAND
running command...
$ cryppo (--version)
cryppo-cli/2.1.0 darwin-arm64 node-v20.11.0
$ cryppo --help [COMMAND]
USAGE
$ cryppo COMMAND
...
cryppo decrypt
cryppo encrypt
cryppo genkey
cryppo genkeypair
cryppo help [COMMANDS]
cryppo sign DESTINATION FILE
cryppo verify DESTINATION FILE
Decrypt a serialized encrypted value with AES or RSA.
USAGE
$ cryppo decrypt -s <value> [-h] [-k <value> | -p <value>]
FLAGS
-h, --help Show CLI help.
-k, --key=<value> base64 encoded data encryption key
-p, --privateKeyFile=<value> private key file (if encrypting with RSA)
-s, --serialized=<value> (required) serialized encrypted value
DESCRIPTION
Decrypt a serialized encrypted value with AES or RSA.
EXAMPLES
$ cryppo decrypt -s "Aes256Gcm.gSAByGMq4edzM0U=.LS0tCml2OiAhYmluYXJ5IHwtCiAgaW1QL09qMWZ6eWw0cmwwSgphdDogIWJpbmFyeSB8LQogIE5SbjZUQXJ2bitNS1Z5M0FpZEpmWlE9PQphZDogbm9uZQo=" -k vm8CjugMda2zdjsI9W25nH-CY-84DDYoBxTFLwfKLDk=
$ cryppo decrypt -s "Rsa4096.bJjV2g_RBZKeyqBr-dSjPAc3qtkTgd0=.LS0tCnt9Cg==" -p private.pem
See code: src/commands/decrypt/index.ts
Encrypt an UTF-8 encoded string with AES or RSA
USAGE
$ cryppo encrypt -v <value> [-h] [-k <value> | -P <value>]
FLAGS
-P, --publicKeyFile=<value> public key file (if encrypting with RSA)
-h, --help Show CLI help.
-k, --key=<value> base64 encoded data encryption key (if encrypting with AES)
-v, --value=<value> (required) value to encrypt
DESCRIPTION
Encrypt an UTF-8 encoded string with AES or RSA
EXAMPLES
encrypt -v "hello world" -k vm8CjugMda2zdjsI9W25nH-CY-84DDYoBxTFLwfKLDk=
encrypt -v "hello world" -P public-key.pem
See code: src/commands/encrypt/index.ts
Generate a new encryption key of random bytes with the specified length - printed as url-safe base64.
USAGE
$ cryppo genkey [-l <value>]
FLAGS
-l, --length=<value> [default: 256] length of the key in bytes to generate: 128, 192 or 256
DESCRIPTION
Generate a new encryption key of random bytes with the specified length - printed as url-safe base64.
EXAMPLES
$ cryppo genkey
$ cryppo genkey -l 192
See code: src/commands/genkey/index.ts
Generate a new RSA key pair, writing the private and public keys to files.
USAGE
$ cryppo genkeypair -p <value> -P <value> [-b <value>]
FLAGS
-P, --publicKeyOut=<value> (required) Public key output path
-b, --bits=<value> [default: 4096] RSA key size
-p, --privateKeyOut=<value> (required) Private key output path
DESCRIPTION
Generate a new RSA key pair, writing the private and public keys to files.
EXAMPLES
$ cryppo genkeypair -p private.pem -P public.pem
See code: src/commands/genkeypair/index.ts
Display help for cryppo.
USAGE
$ cryppo help [COMMANDS] [-n]
ARGUMENTS
COMMANDS Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for cryppo.
See code: @oclif/plugin-help
Sign a file with an RSA private key and write the signed contents to a new file.
USAGE
$ cryppo sign DESTINATION FILE -p <value>
ARGUMENTS
DESTINATION File to write the resulting signed content to
FILE File to sign
FLAGS
-p, --privateKeyFile=<value> (required) path to the private key file
DESCRIPTION
Sign a file with an RSA private key and write the signed contents to a new file.
EXAMPLES
$ cryppo sign -p private.pem my_file.txt my_file.signed.txt
See code: src/commands/sign/index.ts
Verify an RSA signed file and write the contents to another file.
USAGE
$ cryppo verify DESTINATION FILE -P <value>
ARGUMENTS
DESTINATION File to write the resulting verified content to
FILE Signed file contents to verify
FLAGS
-P, --publicKeyFile=<value> (required) path to the public key file
DESCRIPTION
Verify an RSA signed file and write the contents to another file.
EXAMPLES
$ cryppo verify -P public.pem my_file.signed.txt my_file.txt
See code: src/commands/verify/index.ts