This module allows you to encrypt and decrypt files using RSA encryption.
ref https://www.sohamkamani.com/nodejs/rsa-encryption/
Before you begin, ensure you have met the following requirements:
- You have installed Node.js.
- You have installed npm.
To use the RSA module, follow these steps:
- Clone this repository to your local machine.
- Navigate to the project directory.
- Install the required dependencies by running
npm install.
Before you can encrypt or decrypt files, you need to generate a key pair. This can be done by running the following command:
npm run generateThis will generate a public and private key pair and save them in the project directory.
To encrypt a message, run the following command:
npm run encrypt <data>Replace <data> with the message you want to encrypt. This will print encrypted version of the message in the console.
To decrypt a message, run the following command:
npm run decrypt <data>Replace <data> with the message you want to decrypt. This will print a decrypted version of the message in the console.