Questions tagged [python-gnupgp]
20 questions
2
votes
1 answer
How to properly decrypt PGP encrypted file in a AWS Lambda function in Python?
I'm trying to create an AWS Lambda in python that:
downloads a compressed and encrypted file from an S3 bucket
decrypts the file using python-gnupg
stores the decrypted compressed contents in another S3 bucket
This is using python 3.8 and…

Eric Austin
- 81
- 6
1
vote
0 answers
python-gnupg always returning empty decryption result
I am using this piece of code to generate a key, encrypt some content and then decrypt it
with tempfile.TemporaryDirectory() as tmpdir:
gpg = gnupg.GPG(gnupghome=str(tmpdir), verbose=True)
gpg.encoding = 'utf-8'
input_data =…

Thorben Croisé
- 12,407
- 8
- 39
- 50
1
vote
0 answers
gnupg specify gpg-agent path
I am using python-gnupg wrapper, I have copied gpg binary (/usr/bin/gpg) along with dependent libraries identified by ldd gpg command, When defining gpghome i did specify the binary path as well.
gpg = gnugp.GPG(gnupghome='/tmp',…

Sid
- 161
- 1
- 10
1
vote
0 answers
Create PGP signed message with EmailMessage class
I struggle to re-create a script using Python's legacy email API with the current API. The working code replicates this example:
from email.message import Message
from email.mime.multipart import MIMEMultipart
def messageFromSignature(signature):
…

janeden
- 381
- 3
- 11
1
vote
1 answer
python-gnupg is encryptin in wrong format
I'm using python-gnupg to perform pgp encryption to a file. However when i encrypt my fie it is showing up in this format (should be in binary)
-----BEGIN PGP…

Jacob Steiner
- 23
- 5
1
vote
1 answer
Calling GPG method from AWS serverless
I deploy my serverless function using zip method.
I'm trying to encrypt the file using the following code:
import boto3
import gnupg
def lambda_handler(event, context):
s3=boto3.resource('s3')
…

melamed
- 21
- 4
1
vote
1 answer
Openpgp: Using python wrapper python-gnupg 'error - sign-encrypt 17' - Error only when signing
For encrypting and signing a message I want to use the python-gnupgp module. The module is a wrapper of gnupgp.
The encryption works fine, but if I specify the sign option I get an error.
gpg: WARNING: unsafe permissions on homedir…

Matthias Herrmann
- 2,650
- 5
- 32
- 66
0
votes
0 answers
AWSGlue: Decrypt- large files(50GB) using pyhthon-gnupg
Context:
We are receiving files which are PGP encrypted , which needs to be decrypted in AWS Glue using pyhon-gnupg module
Issue:
AWSGlue with PySpark is able to decrypt files upto 2GB files but we are receiving large files up to 50GB and 1TB in S3…

Abhishek Jain
- 171
- 1
- 13
0
votes
0 answers
gpg error There is no assurance this key belongs to the named user
I have the below which I'm running in Airflow. Im fetching the public pgp key file, that's coming from an ftp server, and saving it to a namedtemporaryfile to read to then use to encrypt a file.
However, I'm seeing the error:
There is no assurance…

KristiLuna
- 1,601
- 2
- 18
- 52
0
votes
0 answers
python-gnupg No valid data found with import_keys
I'm trying to read a public key file so I can encrypt a file. I'm using the following code:
import gnupg
import os
import pprint
key_file = '/Users/me/Downloads/id_rsa_test.txt'
gpg = gnupg.GPG()
key_data = open(key_file,…

KristiLuna
- 1,601
- 2
- 18
- 52
0
votes
0 answers
Python gnupg does not generate key
I was trying to generate a key with python-gnupg library. My code is running perfectly but it is not creating a key.
Code:
import gnupg
gpg = gnupg.GPG()
# generate key
input_data = gpg.gen_key_input(
name_real='name',
…

Oguz Gokyuzu
- 13
- 3
0
votes
0 answers
OSError: Unable to run gpg (gpg) - it may not be available
I am currently trying to decrypt a .gpg file in python using the package python-gnupg.
However, when I run my script:
file = input.xml.gpg
gpg = gnupg.GPG()
with open(file, 'rb') as f:
status = gpg.decrypt_file(f, passphrase='***********',…

David Nahmias
- 1
- 1
0
votes
1 answer
Is there a way to decrypt an encrypted file using Python libraries?
I was given a task wherein I am to write a python script that can be used to decrypt some encrypted files.
I was given with
examplefile.pgp (Encrypted file having text data)
examplepublic.asc (Public Key in asc format)
example.pkr (Public…

Rahul M
- 1
0
votes
1 answer
Python-gnupg cant find secret key
I have an Ubuntu 20.04 server. On the server I am running a python script to decrypt some PGP encrypted files. I have added the PGP keys to a keyring and can decrypt a file using the command line:
gpg --output test.zip --decrypt myfile.pgp
The…

Andy
- 919
- 2
- 9
- 22
0
votes
1 answer
How to Python gnupg (GPG) encrypt with recipient's email address rather than their fingerprint?
How to Python-gnupg (GnuPG / GPG / OpenPGP) encrypt with recipient's email address rather than their fingerprint?
This example shows (which failes on my Ubuntu 20.04 / such a thing, but it's an old example; excerpt:
encrypted_data =…

Johnny Utahh
- 2,389
- 3
- 25
- 41