This repository contains a simple Java-based command-line application for encrypting and decrypting files using a custom encryption algorithm. The system provides the following functionalities:
Encrypt a file Decode an encrypted file Quit the system
JDK 8 or later
Clone the repository: Download Copy code git clone https://github.com/your-username/file-encryption-decryption.git Navigate to the project directory: Download Copy code cd file-encryption-decryption Compile the Java files: Download Copy code javac Active.java Decode.java Encrypt.java Key.java Run the application: Download Copy code java Active
Upon running the application, you will be prompted to select one of the following options:
- Ecrypt File
- Decode encrypted file
- Quit system
- Enter the corresponding number to perform the desired action.
To encrypt a file, follow these steps:
Select option 1 (Ecrypt File) from the main menu. Enter the file path for the file you want to encrypt. Enter the level of encryption (an integer value). The encrypted file will be saved with the same name as the original file, but with the suffix _encrypted.txt appended to it.
To decode an encrypted file, follow these steps:
Select option 2 (Decode encrypted file) from the main menu. Enter the path for the encrypted file you want to decode. The decoded file will be saved with the same name as the original encrypted file, but with the suffix _decode.txt appended to it.
The custom encryption algorithm used in this application involves creating a key based on the level of encryption provided by the user. The key is then used to map each character in the input file to a new character based on the key values. The decoding process reverses this mapping to restore the original content of the file.