This tool is a very basic and simple implementation of the RSA encryption and decryption in Typescript. RSA is an asymmetric cryptographic algorithm used for secure data transmission
- Generate RSA Key Pair (Public Private Key pair)
- Encrypt files and store that encrypted file
- Decrypt encrypted files
- Sign a file with your private key
- Verify the signature of any signed document
Important: Before installing this tool with the help of the install script, it is mandatory to install the latest version of NodeJS and NPM to make sure that the tool works
To see how to install NodeJS and NPM(if not already installed), go to Installing NodeJS
To install the tool, clone the repository and run the install script. It will ask for admin privileges, so provide the password when prompted
It asks for admin privileges only because it needs to create a symlink, so that the tool can be accessed globally
git clone https://github.com/AnirudhRevanur/rsa-tool.git ~/rsa-tool
cd ~/rsa-tool
./install.sh
The script automatically installs all the dependencies, compiles the Typescript code into Javascript code, and configures the command line interface for easy access
You can verify the installation by running the following command
rsa-tool
To generate a new pair of keys, run the command
rsa-tool --generate <privateKey> <publicKey>
To encrypt a file, use the following command
rsa-tool --encrypt <inputFile> <outputFile> <publicKey>
We can use files over here, because I have performed chunking, as to allow larger messages or files to be encrypted by the RSA algorithm
To decrypt any file, use the following command
rsa-tool --decrypt <inputFile> <outputFile> <privateKey>
In order to sign a file, run the following command
rsa-tool --sign <inputFile> <signatureFile>
In order to verify a signature, run the following command
rsa-tool --verify <inputFile> <signatureFile>
- Implement an algorithm that encrypts the file using AES, then encrypts the AES key with the shared RSA key
- Feel free to add more features or rewrite this in Rust idm :)