Recently, I’ve written a CLI for RSA encryption and decryption - RSA CLI.
RSA CLI is based on Node.js, works perfectly with all the desktop platforms.
If you have Node.js environment on your device, with the help of npm, you can install it by running a single line of command:
1 | $ npm install -g rsa-cli |
Yarn is also supported:
1 | $ yarn global add rsa-cli |
Without Node.js environment, it’s still easy to install. Just download the executable for your device in GitHub Releases and execute it.
Now start encrypting:
0x00
1 | $ rsa generate [keyName] |
Run the command above to generate a new key pair. Modulus length is 2048 by default, and if you want to change it, use -l
flag:
1 | $ rsa generate [keyName] -l 4096 |
Remember [keyName]
, it’s needed for next steps.
0x01
Get your public key by running:
1 | $ rsa get [keyName] |
Copy -----BEGIN RSA ...... END RSA PUBLIC KEY-----
and save it to a file, then send this file to your friend.
Your friend should also install RSA CLI, he/she need to download it and import it:
1 | $ rsa import [yourFriendsKeyName] --public [path-to-the-file] |
The next step is to encrypt a message:
1 | $ rsa encrypt [yourFriendsKeyName] '[message]' |
Finally, tell your friend to copy the output and send it to you.
0x02
After receiving the encrypted message from your friend, you can now decrypt it:
1 | $ rsa decrypt [keyName] '[the-encrypted-message-from-your-friend]' |
Done! you got the decrypted message from the output.
I think privacy should be in your control. You should not trust anyone who can’t proof your privacy is encrypted and private. Trust yourself. RSA CLI is an easy way to encrypt and decrypt on your own, which means you can really know your privacy is encrypted. Without private key, no one can decrypt your messages.
But why trusting RSA CLI? Because it’s fully open source.
About this Post
This post is written by Mr. Will, licensed under CC BY-NC 4.0.