GPG encryption error ...


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users GPG encryption error ...
# 1  
Old 01-24-2017
GPG encryption error ...

Hi. I'm hitting issues using gpg to encrypt a text file on Linux.

Code:
gpg -c --passphrase 123 --cipher-algo AES256 test
gpg: cancelled by user
gpg: error creating passphrase: Operation cancelled
gpg: symmetric encryption of `test' failed: Operation cancelled


In this case the file test just has a few numbers in it. This is something that has worked in the past so it's a configuration issue but I'm struggling to work out exactly what that issue is.

The daemon is running ...
Code:
$pidof gpg-agent
1532011 1504881

I tried setting GPG_AGENT_INFO but it doesn't make a difference

Any ideas of the approach I should take to resolve this?
Many thanks.
# 2  
Old 01-24-2017
How exactly are you running this? Locally or remotely? Over ssh? Through a tunnel?

From this bug:

Quote:
Unfortunately this is a design limitation of the GnuPG2 that it always requires access rights to open the tty for the pinentry.
A work-around may be running it inside a screen session.
# 3  
Old 01-24-2017
Hi. I'm running it locally.
# 4  
Old 01-29-2017
in the end I just used openssl to encrypt/decrypt a txt file and it worked fine:

Code:
 
print "abc123" > keyfile
print "testing 123" > plaintext.txt 
openssl aes-256-cbc -a -salt -in plaintext.txt -out plaintext.txt.enc -pass file:keyfile
rm plaintext.txt 
openssl aes-256-cbc -d -a -in plaintext.txt.enc -out plaintext.txt -pass file:keyhole
cat plaintext.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Gpg (GnuPG) encryption and decryption

Hi Friends, There are some 7 years script in out linux server. I am trying to understand them since Linux Server changed(A). Below line in one of the encrypting script. Here scenario is encrypting bank files in our (A) server and doing Secure Copy to Server (B). GPG -v --batch --yes --armor... (1 Reply)
Discussion started by: johnsnow
1 Replies

2. Cybersecurity

File encryption tools with MAC address as an encryption key

Hi all, I'm looking for secure file encryption tools that use MAC address as encryption key. FYI, I'm using Red Hat Enterprise Linux OS. For example: when A wants to send file to B A will encrypt the file with B's computer MAC/IP address as an encryption key This file can only be decrypted... (2 Replies)
Discussion started by: sergionicosta
2 Replies

3. Solaris

GPG encryption utility in Solaris 10

Hi All, I am working on Solaris 10 OS on X4170M2 server. I have some .gpg encrypted files and i want to decrypt them but i dont know how to install the binary of gpg. Here is the binary in system : root@ecmstest # ls -larth total 1273904 -rw-r--r-- 1 root root 3.5M Oct 14 ... (1 Reply)
Discussion started by: Deepa Jain
1 Replies

4. Shell Programming and Scripting

Need help on File Encryption using gpg

Folks, Is there anyone to help on GPG file encryptions here. I got a public key from third party. I imported the key in server. I want to encrypt the public key. But without being signed , the key cannot be encrypted. When I try to sign the key using lsign command, I am getting the below... (1 Reply)
Discussion started by: dinesh1985
1 Replies

5. Linux

Error: Encryption support not enabled

Hi when I run the following GET commad: ./snmpget -m ALL -M /data/net/naamab/snmp/snmp_mib/ -v 3 -a MD5 -l authPriv -u test1 -A welcome1 -x DES -X privpass 127.0.0.1 NOVELSAT-MODULATOR-MIB::nsModLineCMMode.0 -d I get the error: Encryption support not enabled. snmpget: USM encryption... (1 Reply)
Discussion started by: naamabm
1 Replies

6. Ubuntu

Can't update or use package manager -- gpg error

W: GPG error: http://archive.canonical.com karmic Release: Unknown error executing gpgv W: GPG error: http://us.archive.ubuntu.com karmic Release: Unknown error executing gpgv W: GPG error: http://us.archive.ubuntu.com karmic-updates Release: Unknown error executing gpgv W: GPG error:... (17 Replies)
Discussion started by: CRGreathouse
17 Replies

7. Linux

GPG error on Debian 4 using apt-get

Hello, I wish to update a debian 4.0 server we have but cannot get past the following error message. my keys are as follows: Any help would be good. (0 Replies)
Discussion started by: pobman
0 Replies

8. Solaris

Public keys for GPG Encryption

HI, I'm trying to encrypt a file and i'll FTP it to a external server.When i encrypt it using the command gpg -e -r 'recipient name' <filename> its asking me for public keys.Is there a way to encrypt without having to give the public keys? or if i need to give public keys i... (1 Reply)
Discussion started by: James777
1 Replies

9. UNIX for Dummies Questions & Answers

File encryption/Key encryption ????

My dilemma, I need to send, deemed confidential, information via e-mail (SMTP). This information is sitting as a file on AIX. Typically I can send this data as a e-mail attachment via what we term a "mail filter" using telnet. I now would like to somehow encrypt the data and send it to a e-mail... (1 Reply)
Discussion started by: hugow
1 Replies
Login or Register to Ask a Question