A simple command-line tool for encrypting and decrypting files using the Caesar cipher.
- Encrypt or decrypt a file using a user-defined shift value.
- Progress reporting during file processing.
- Error handling for file existence and input validation.
- User-friendly command-line interface.
- Ensure you have a C++ compiler installed (e.g., GCC, Clang, or MSVC).
- Clone this repository or download the source code.
- Compile the program using the following command:
g++ FileEncryptor.cpp -o FileEncryptor
Run the program using:
./FileEncryptorFollow the prompts to:
- Choose the operation (1 for encryption, 2 for decryption).
- Enter a Caesar cipher shift value (1-25).
- Provide the input file path (the file to be processed).
- Provide the output file path (the new file to be created).
Note: The output file must not already exist. If it does, the program will display an error.
To encrypt a file named test.txt with a shift value of 3 and save the result as encrypted.txt, run the program and enter:
- Operation: 1
- Shift value: 3
- Input file path: test.txt
- Output file path: encrypted.txt
This project is open-source and available under the MIT License.
The program uses the Caesar cipher algorithm:
- Each letter is shifted by the specified number of positions in the alphabet
- Non-alphabetic characters remain unchanged
- Case sensitivity is preserved
- The shift value wraps around the alphabet (e.g., 'z' shifted by 1 becomes 'a')
This is a basic encryption tool using the Caesar cipher. While it provides basic text obfuscation, it should not be used for securing sensitive information. For real security needs, use established encryption libraries and algorithms.
FileEncryptor.cpp- Main source code file- Input/output files are created by the user during runtime
- GitHub: @Presktok
Potential enhancements for future versions:
- Add support for different encryption algorithms
- Implement file integrity checking
- Add password protection
- Support for binary files
- Add batch processing capability
- Implement a graphical user interface