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
GnuPG::Options(3pm)					User Contributed Perl Documentation				       GnuPG::Options(3pm)

NAME
GnuPG::Options - GnuPG options embodiment SYNOPSIS
# assuming $gnupg is a GnuPG::Interface object $gnupg->options->armor( 1 ); $gnupg->options->push_recipients( 'ftobin', '0xABCD1234' ); DESCRIPTION
GnuPG::Options objects are generally not instantiated on their own, but rather as part of a GnuPG::Interface object. OBJECT METHODS
new( %initialization_args ) This methods creates a new object. The optional arguments are initialization of data members. hash_init( %args ). copy Returns a copy of this object. Useful for 'saving' options. get_args Returns a list of arguments to be passed to GnuPG based on data members which are 'meta_' options, regular options, and then extra_args, in that order. OBJECT DATA MEMBERS
homedir armor textmode default_key no_greeting verbose no_verbose quiet batch always_trust comment status_fd logger_fd passphrase_fd compress_algo force_v3_sigs rfc1991 openpgp options no_options encrypt_to recipients These options correlate directly to many GnuPG options. For those that are boolean to GnuPG, simply that argument is passed. For those that are associated with a scalar, that scalar is passed passed as an argument appropriate. For those that can be specified more than once, such as recipients, those are considered lists and passed accordingly. Each are undefined or false to begin. Meta Options Meta options are those which do not correlate directly to any option in GnuPG, but rather are generally a bundle of options used to accomplish a specific goal, such as obtaining compatibility with PGP 5. The actual arguments each of these reflects may change with time. Each defaults to false unless otherwise specified. These options are being designed and to provide a non-GnuPG-specific abstraction, to help create compatibility with a possible PGP::Interface module. To help avoid confusion, methods with take a form of a key as an object shall be prepended with _id(s) if they only take an id; otherwise assume an object of type GnuPG::Key is required. meta_pgp_5_compatible If true, arguments are generated to try to be compatible with PGP 5.x. meta_pgp_2_compatible If true, arguments are generated to try to be compatible with PGP 2.x. meta_interactive If false, arguments are generated to try to help the using program use GnuPG in a non-interactive environment, such as CGI scripts. Default is true. meta_signing_key_id This scalar reflects the key used to sign messages. Currently this is synonymous with default-key. meta_signing_key This GnuPG::Key object reflects the key used to sign messages. meta_recipients_key_ids This list of scalar key ids are used to generate the appropriate arguments having these keys as recipients. meta_recipients_keys This list of keys of the type GnuPG::Key are used to generate the appropriate arguments having these keys as recipients. You probably want to have this list be of the inherited class GnuPG::SubKey, as in most instances, OpenPGP keypairs have the encyrption key as the subkey of the primary key, which is used for signing. Other Data Members extra_args This is a list of any other arguments used to pass to GnuPG. Useful to pass an argument not yet covered in this package. SEE ALSO
GnuPG::Interface, perl v5.12.4 2010-05-10 GnuPG::Options(3pm)