This Python script allows you to perform randomized encryption and decryption on text messages. The encryption process adds a random offset to the ASCII value of each character, while the decryption process reverses this offset.
- Python 3.6 or above should be installed on your system. If Python is not installed, you can download it from the official Python website: https://www.python.org/downloads/
Follow these steps to run the script using a virtual environment (pipenv):
- Clone the Repository:
git clone <repository_url>
cd <repository_directory>
- Navigate to the project directory:
cd Encryption-Decryption
- Create a virtual environment:
On macOS and Linux:
python3 -m venv venv
On Windows:
py -m venv venv
- Activate the virtual environment: On macOS and Linux:
source venv/bin/activate
On Windows:
venv\Scripts\activate
- Install the required packages:
pip3 install -r requirements.txt
This will install all the necessary dependencies for the project in the python environment.
Run the Python script using the following command:
python3 main.py
The script will prompt you to choose between encryption and decryption, specify a seed, and provide the text to be processed.
If you prefer to use a file for input, you can place your text in input.txt
before running the script.
- Viewing the Output:
The script will display the result on the console. Additionally, the output will be saved to output.txt
.
-
When prompted for encryption or decryption, enter
0
for encryption or1
for decryption. -
The seed you provide will determine the randomness of the encryption. Using the same seed for decryption as used for encryption will yield the original text.
-
For text input, simply type or paste your text when prompted. Alternatively, you can provide the input by placing it in the
input.txt
file.
Once you're done, you can exit the venv:
On macOS and Linux:
deactivate
On Windows:
deactivate.bat
You can also delete the files associated with it if you want, but you don't have to. This action cannot be undone.
On macOS and Linux:
rm -r venv
On Windows:
rmdir /s /q venv
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to modify the instructions based on your project's specific setup and requirements.