Problem with GnuPG...need help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem with GnuPG...need help
# 1  
Old 08-29-2007
Problem with GnuPG...need help

hello,


i am writing an automated script for GnuPG decryption for a file, which was already being encrypted,

homedir="/home/.gnupg"
PassPhrase=`cat /home/.gnupg/.passphrase`
echo $PassPhrase | gpg --homedir $homedir --passphrase-fd 0 --no-tty --output secret21.txt --decrypt-files secret2.txt


here bolded are the parameter passed.

but while executing the script it throws the following error
gpg: --output doesn't work for this command


if i modified the script i.e. hard code the pass phrase instead of getting it from the file, it works fine,

homedir="/home/.gnupg"
echo "mypassphrase" | gpg --homedir $homedir --passphrase-fd 0 --no-tty --output secret21.txt --decrypt secret2.txt


but this is not way , i want pass pharse should also get into script some hidden way.....
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. Solaris

Gnupg library issues on Solaris 11

I have installed gnupg from the official Solaris 11 repository, but am experiencing library issues. This is the error I am getting: ld.so.1: gpg2: fatal: relocation error: file /usr/lib/libreadline.so.5: symbol tgetent: referenced symbol not foundSee more information here: bash-4.1$ gpg2... (4 Replies)
Discussion started by: ujjain
4 Replies

3. Shell Programming and Scripting

GnuPG Syntax Help

Hi all, I'm trying to decrypt a GnuPG file but not having much luck. I'm new to using it and have tried 4 different ways to do it but nothing works. Here are examples of the attempts I have made: gpg -o ./file_name.tar.Z --passphrase-fd 0 ./file_name.tar.Z.gpg 0<./password.txt cat... (5 Replies)
Discussion started by: Korn0474
5 Replies

4. UNIX for Dummies Questions & Answers

Import and export PGP/GnuPG keys

Hi, I need to export an existing PGP key and import it into GnuPG on a different machine. This is how I did the export: pgp -kx myuser _myuser_public pgp -kx myuser _myuser_private secring.skr (this is from the pgp installation directory that contains secring.skr). This produced two... (0 Replies)
Discussion started by: imchi
0 Replies

5. Cybersecurity

[PGP/GnuPG] Importing and signing keys

Hi, I need to export an existing PGP key and import it into GnuPG on a different machine. This is how I did the export: pgp -kx myuser _myuser_public pgp -kx myuser _myuser_private secring.skr (this is from the pgp installation directory that contains secring.skr). This produced two... (0 Replies)
Discussion started by: imchi
0 Replies

6. Ubuntu

How to use GnuPG with MUTT, getting error!

I am using MUTT and I have configured my gmail account in it. I want to use GnuPG(gpg) in it. But even after importing I get key not found error while sending. Please help me for this problem. ---------- Post updated at 11:26 PM ---------- Previous update was at 07:48 AM ---------- This is... (0 Replies)
Discussion started by: nixhead
0 Replies

7. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies

8. UNIX for Dummies Questions & Answers

Gnupg

hey guys i need to restrict access to the GNUPG program because of the possibility that sensitive data like encryption keys and passwords that it is using may be written into the virtual memory swap partition on the hard disk and thus be retrieved at a later date long after the program has... (2 Replies)
Discussion started by: mile1982
2 Replies

9. Shell Programming and Scripting

GnuPG (gpg command)

I've been blessed with the task of writing functions that will be used to encrypt / decrypt data files using the Gnupg (gpg command) software on our Solaris 9. This was just installed last friday and I've got no documentation other than what I've found on the web. I was successful in writing... (4 Replies)
Discussion started by: BCarlson
4 Replies
Login or Register to Ask a Question
GPGV(1) 							 GNU Privacy Guard							   GPGV(1)

NAME
gpgv - Verify OpenPGP signatures SYNOPSIS
gpgv [options] signed_files DESCRIPTION
gpgv is an OpenPGP signature verification tool. This program is actually a stripped-down version of gpg which is only able to check signatures. It is somewhat smaller than the fully-blown gpg and uses a different (and simpler) way to check that the public keys used to make the signature are valid. There are no configuration files and only a few options are implemented. gpgv assumes that all keys in the keyring are trustworthy. By default it uses a keyring named 'trustedkeys.gpg' which is assumed to be in the home directory as defined by GnuPG or set by an option or an environment variable. An option may be used to specify another keyring or even multiple keyrings. RETURN VALUE
The program returns 0 if everything is fine, 1 if at least one signature was bad, and other error codes for fatal errors. OPTIONS
gpgv recognizes these options: --verbose -v Gives more information during processing. If used twice, the input data is listed in detail. --quiet -q Try to be as quiet as possible. --keyring file Add file to the list of keyrings. If file begins with a tilde and a slash, these are replaced by the HOME directory. If the file- name does not contain a slash, it is assumed to be in the home-directory ("~/.gnupg" if --homedir is not used). --status-fd n Write special status strings to the file descriptor n. See the file DETAILS in the documentation for a listing of them. --logger-fd n Write log output to file descriptor n and not to stderr. --ignore-time-conflict GnuPG normally checks that the timestamps associated with keys and signatures have plausible values. However, sometimes a signature seems to be older than the key due to clock problems. This option turns these checks into warnings. --homedir dir Set the name of the home directory to dir. If this option is not used, the home directory defaults to '~/.gnupg'. It is only recog- nized when given on the command line. It also overrides any home directory stated through the environment variable 'GNUPGHOME' or (on W32 systems) by means of the Registry entry HKCUSoftwareGNUGnuPG:HomeDir. EXAMPLES
gpgv pgpfile gpgv sigfile [datafile] Verify the signature of the file. The second form is used for detached signatures, where sigfile is the detached signature (either ASCII-armored or binary) and datafile contains the signed data; if datafile is "-" the signed data is expected on stdin; if datafile is not given the name of the file holding the signed data is constructed by cutting off the extension (".asc", ".sig" or ".sign") from sigfile. FILES
~/.gnupg/trustedkeys.gpg The default keyring with the allowed keys. ENVIRONMENT
HOME Used to locate the default home directory. GNUPGHOME If set directory used instead of "~/.gnupg". SEE ALSO
gpg2(1) The full documentation for this tool is maintained as a Texinfo manual. If GnuPG and the info program are properly installed at your site, the command info gnupg should give you access to the complete manual including a menu structure and an index. GnuPG 1.4.12 2014-09-03 GPGV(1)