Discussion:
GPG Newbie: Windows DOS command-line problems
(too old to reply)
x
2008-09-21 20:09:59 UTC
Permalink
I'm a newbie to PGP and GnuPG and I'm having problems. I installed the
latest GnuPG installation (1.4.9) and I have setup some public/private
keys using the GPA Windows UI.

But when I run in the Windows XP cmd window and try to execute the
command
gpg --encrypt "ABC" "MYFILE.TXT" > "MYFILE.TXT.PGP"
then I get the error(?) message
usage: gpg [options] --encrypt [filename]
The resulting MYFILE.TXT.PGP is empty. I've been reading all the
guides I can - but nothing seems to cover this issue. What have I done
wrong here?

Many thanks
AB
Guy
2008-09-21 21:04:24 UTC
Permalink
Post by x
But when I run in the Windows XP cmd window and try to execute the
command
gpg --encrypt "ABC" "MYFILE.TXT" > "MYFILE.TXT.PGP"
then I get the error(?) message
usage: gpg [options] --encrypt [filename]
What are you trying to accomplish, what is "ABC" to be?

If "ABC" is passphrase do like:

$ gpg --output myfile.txt.pgp --symmetric myfile.txt

and enter passphrase at prompt.

Or

$ echo.ABC| gpg --passphrase-fd 0 -o myfile.txt.pgp -c myfile.txt


If "ABC" is key then do like:

$ gpg --recipient ABC --output myfile.txt.pgp --encrypt myfile.txt

Or

$ gpg -r ABC -o myfile.txt.pgp -e myfile.txt
Post by x
The resulting MYFILE.TXT.PGP is empty. I've been reading all the
guides I can - but nothing seems to cover this issue. What have I
done wrong here?
Do...

$ gpg -h > gpghelp.txt & notepad gpghelp.txt

and read, it explains most what you need.

If you need more... read the man page.
--
OpenPGP: id=18795161E22D3905; preference=signencrypt;
url=http://guysalias.fateback.com/pgpkeys.txt
x
2008-09-21 22:21:56 UTC
Permalink
Post by Guy
Post by x
But when I run in the Windows XP cmd window and try to execute the
command
    > gpg --encrypt "ABC" "MYFILE.TXT" > "MYFILE.TXT.PGP"
then I get the error(?) message
    > usage: gpg [options] --encrypt [filename]
What are you trying to accomplish, what is "ABC" to be?
$ gpg --output myfile.txt.pgp --symmetric myfile.txt
and enter passphrase at prompt.
Or
$ echo.ABC| gpg --passphrase-fd 0 -o myfile.txt.pgp -c myfile.txt
$ gpg --recipient ABC --output myfile.txt.pgp --encrypt myfile.txt
Or
$ gpg -r ABC -o myfile.txt.pgp -e myfile.txt
Post by x
The resulting MYFILE.TXT.PGP is empty. I've been reading all the
guides I can - but nothing seems to cover this issue. What have I
done wrong here?
Do...
$ gpg -h > gpghelp.txt & notepad gpghelp.txt
and read, it explains most what you need.
If you need more... read the man page.
--
OpenPGP: id=18795161E22D3905; preference=signencrypt;
            url=http://guysalias.fateback.com/pgpkeys.txt
Thanks Guy - but all of these suggestions (except the -h one) are
resulting in a similar "usage" error message :

[[code]]
C:\>gpg --list-keys

C:\>C:/Documents and Settings/********/Application Data/gnupg
\pubring.gpg
----------------------------------------------------------------------
pub 1024D/F91CA557 2008-09-21
uid ABC <***@zzzzz.com>
sub 2048g/68654EBC 2008-09-21


C:\>echo ABC | gpg --passphrase-fd 0 -o DBS.TXT.PGP --encrypt DBS.TXT

C:\>Reading passphrase from file descriptor 0
usage: gpg [options] --encrypt [filename]

C:\>gpg -r ABC -o DBS.TXT.PGP -e DBS.TXT

C:\>usage: gpg [options] --encrypt [filename]
[[/code]]
Otto Sykora
2008-09-22 10:39:11 UTC
Permalink
On 22.09.2008 00:21, x wrote:
and if you try something in this direction or similar?

gpg -e [myfile] -r [keyid]


try with minimum parameters first
Otto Sykora
2008-09-22 10:47:46 UTC
Permalink
what is the user ID of the key you are encrypting to?

try the user ID instead of the mail adr, then it might work?
Otto Sykora
2008-09-22 10:50:20 UTC
Permalink
Post by x
I'm a newbie to PGP and GnuPG and I'm having problems. I installed the
latest GnuPG installation (1.4.9) and I have setup some public/private
keys using the GPA Windows UI.
But when I run in the Windows XP cmd window and try to execute the
command
gpg --encrypt "ABC" "MYFILE.TXT" > "MYFILE.TXT.PGP"
then I get the error(?) message
usage: gpg [options] --encrypt [filename]
The resulting MYFILE.TXT.PGP is empty. I've been reading all the
guides I can - but nothing seems to cover this issue. What have I done
wrong here?
Many thanks
AB
the
gpg -r [userid] -e [myfile]

does work here with gpg147

or
gpg --recipient [userid] --encrypt [myfile]
Speechless
2008-09-23 05:06:21 UTC
Permalink
Post by x
I'm a newbie to PGP and GnuPG and I'm having problems. I installed the
latest GnuPG installation (1.4.9) and I have setup some public/private
keys using the GPA Windows UI.
You might need to sort out the contents of your configuration
file: gpg.conf

The following gpg.conf has worked for me across all platforms of M/S DOS,
M/S Windows, Linux, *BSD, etc. and across all versions of the software,
up to and including GnuPG v1.4.9:

comment ""
default-key 0x<????????????????>

Where: <????????????????> is the last 16 characters of the
fingerprint for your key prefixed by 0x (zero lower case x)
Display fingerprint using command:
gpg --fingerprint "<Your Name>"
Example: default-key 0x9D2B588B2B5C1412

default-recipient-self
encrypt-to "<Your Name>"

Where: <Your Name> is your full name as it appears on your emails
Example: encrypt-to "Joe Smith" (Note the quotation marks)

no-greeting
armor
no-version

The above configuration creates encrypted files that are ASCII armored and
ready for sending as an attachment to a regular email. These files have
a .asc filename suffix.
Post by x
But when I run in the Windows XP cmd window and try to execute the
command
gpg --encrypt "ABC" "MYFILE.TXT" > "MYFILE.TXT.PGP"
Once you have your gpg.conf file sorted out as I've indicated above,
you need to use the correct command syntax, as follows:

Help: gpg -h

Encrypt: gpg -e <file_name_to_encrypt>
Example: gpg -e mysecret.txt
(The above encrypts to yourself only.)

gpg -er "<recipient_name>" <file_name_to_encrypt>
Example: gpg -er "Joe Smith" mysecret.txt
(The above encrypts to yourself and specified recipient.)

Note: You must have the recipient's public key on your
key ring, before you can encrypt to the individual.

Read: gpg -d <encrypted_filename>
Example: gpg -d mysecret.txt.asc

Decrypt: gpg -d <encrypted_filename> > <decrypted_filename>
Example: gpg -d mysecret.txt.asc > NoLongerSecret.txt
Post by x
then I get the error(?) message
usage: gpg [options] --encrypt [filename]
The resulting MYFILE.TXT.PGP is empty. I've been reading all the guides
I can - but nothing seems to cover this issue. What have I done wrong
here?
Many thanks
AB
Loading...