This project is a command-line tool designed to encrypt and decrypt seed phrases using a password. It processes text files line by line, either encrypting or decrypting the content depending on the mode (encryption or decryption). The tool uses Node.js's file system module (fs
), path handling, and stream processing to ensure efficient file operations.
- Encryption and Decryption: Encrypt or decrypt seed phrases line by line.
- Password Protection: Secures seed phrases using a user-provided password.
- File Streaming: Processes files using streams to handle large files efficiently.
- Customizable Input and Output: Users can specify input and output file paths.
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Install dependencies:
npm install
The tool supports both encryption and decryption modes. The mode is determined by the npm script used.
To encrypt a list of seed phrases from a file, run the following command:
npm run encrypt <input-file> <output-file>
• inputFilePath (optional): Path to the file containing the seed phrases (default: ../data/seed_phrases.txt).
• outputFilePath (optional): Path to the file where the encrypted seed phrases will be saved (default: ../data/encrypted_seed_phrases.txt).
You will be prompted to enter a password that will be used to encrypt the seed phrases.
🔓 Decrypting Seed Phrases
To decrypt a list of encrypted seed phrases, run the following command:
npm run decrypt <input-file> <output-file>
• inputFilePath (optional): Path to the file containing the encrypted seed phrases (default: ../data/encrypted_seed_phrases.txt).
• outputFilePath (optional): Path to the file where the decrypted seed phrases will be saved (default: ../data/decrypted_seed_phrases.txt).
You will be prompted to enter the password that was used for encryption.
• data/ - The directory where default input and output files are stored.
• src/cryptoUtils.js - Contains utility functions for encrypting and decrypting the seed phrases.
• src/userInput.js - Manages user input for getting the password securely.
• src/index.js - The main entry point of the tool that coordinates file reading, writing, and encryption/decryption processes.
This project is licensed under the MIT License.