I have an encrypted message as a string in python. I want to decrypt it with a program called gpg.
In terminal, using gpg requires:
- gpg --decrypt -a
- Then it prompts you for the encrypted message
- Then it prompts for private key.
Is there a way to do all of this in python when the encrypted message is saved in a variable in python? I know you use the os module to make terminal commands to other programs.
import os import getpass message = '093j0rawrkj2or2r' private_key = getpass.getpass() os.system("gpg --decrypt -a") ...?