This Python script automates the process of importing GPG keys and encrypting files using those keys. It provides options to import keys from the local machine or the Ubuntu key server, and then encrypt files based on the selected key.
If you prefer not to install the prerequisites manually, an executable version of the script called "AutoGPG.exe" is available. AutoGPG bundles all the necessary dependencies, allowing you to run the script without installing additional packages, but it runs a little slow and you still have to install gnupg on your system.
You can download the AutoGPG executable from the following link:
Before running this script, make sure you have the following prerequisites installed:
- Python 3.x
- GnuPG (GPG) command-line tool (
gpg) - Playwright Python library
- Colorama Python library
You can install the required Python packages by running the following command:
pip install playwright coloramathen
playwright installYou also need to have the GnuPG command-line tool (gpg) installed on your machine. If it's not already installed, you can install it on Ubuntu using the following command:
sudo apt-get install gnupgIn Windows
winget install gnupgTo use the script, follow these steps:
-
Open a terminal and navigate to the directory where the script is located.
-
Run the Python script
autogpg.pyusing the following command:python autogpg.py
-
The script will display a menu with two options:
What do you want to do: 1: To import a key 2: To encrypt using a key that is already imported -
Choose an option by entering the corresponding number and pressing Enter.
-
If you choose option 1, you will be prompted to select the source of the key: the local machine or the Ubuntu key server.
-
If you choose the local machine, you need to provide the path to the directory containing the public key files you want to import.
-
If you choose the Ubuntu key server, you will be prompted to enter the key name and the path to save the key file.
-
-
If you choose option 2, you will be prompted to enter the path to the files you want to encrypt and the recipient's username.
-
-
Follow the on-screen instructions and provide the required information as prompted.
-
The script will perform the selected action (importing keys or encrypting files) and display the progress.
-
If you choose to encrypt files and confirm moving the encrypted files to another location, you will be prompted to enter the destination folder.
-
Once the script finishes executing, you can check the results based on the action you performed.
This script is licensed under the MIT License.
If you have any questions or need further assistance, feel free to contact me:
- Name: omar
- Email: oumessaoud-omar@proton.me