#!/usr/bin/env python3 #-*- coding:utf-8 -*- import urllib.request import subprocess from subprocess import PIPE import gpg # dpaste.com -expire at 2021-12-12 url = 'https://dpaste.com/BS9ND84LP.txt' with urllib.request.urlopen( url ) as response: cipher = response.read().decode('utf-8') print(cipher,"\n") key='jijibeti' try: plaintext, result, verify_result = gpg.Context().decrypt(cipher.encode('utf-8')) except gpg.errors.GPGMEError as e: plaintext = None print(e) #cmdline = 'gpg -d' #process=subprocess.run(cmdline, input=cipher, stdout=PIPE, shell=True, text=True) #plaintext=process.stdout print(str(plaintext, encoding='utf-8'), "\n")