Mailing List Archive

Lost Newbie
I'm pretty much lost, and am not even sure if gnupg is the tool that I
thought it was...

Here's what I want to do:

In a PHP script on my web server, use gnupg to encrypt a credit card
number, (I guess using some password that only I and/or the client know).
Err, make that a public password to encode. See below.

E-mail that encrypted data to somebody on a Mac or PC.

They pull out their secret decoder ring, plug in the password (make that a
private decoding password) and the encrypted text, and out pops the
customer's credit card number.

I'm not so worried that their e-mail client has some fancy plug-in to
automagically decrypt the message, but that would be a nice plus.

This is for starving musicians to sell a CD or two a month, and maybe even
be able to pay back the pressing costs of the CD. Studio time, rehearsal
time, advertising, etc are pretty much just written off as cost of doing
business loss, which is why they're called starving musicians. So,
commercial options are right out...

Anyway, I've read the README, and the web page and its man page, and I'm
totally lost with the keys and keyrings and trusted users. I somewhat
understand the point of keyrings in terms of ensuring that the data came
from the right person, but I'm not sure how/if I need to apply it in terms
of what I want to do.

I haven't even begun to figure out how I'm gonna get the "secret decoder
ring" running on their Macs or PCs. I guess I could telnet in to the
server, decode the cc# for them, and they'd feel happy, but it seems to me
that anybody smart enough to be snagging cc#s in the first place could
happen upon my telnet session and snarf them out of there, too. Of course,
it's not like the decoding will happen often enough to be high profile to
anybody, but I might as well do this right, if I'm going to do it.

If it's the only option, I'm willing and more-or-less able to write a
minimal c++ client for PC (and Mac, if I can find a compiler). By minimal
I mean slapping a two-box interface on top of gpg that takes in the
password and encrypted text, calls the gpg decoder with them, and prints
out the result text. By able I mean that I can compile a gpg library, I
reckon, if somewhat slowly and with many halts while I try to figure out
what the hell is wrong with Windoze that Unix expects to be there, and I'm
an interface hacker by trade, so I got that part down. :-)

I tried just messing around a little with what would seem to me to be
reasonable flags to gpg. I even found a combination or two that didn't
yell at me. :-)

./gpg -r -e /pathtosillyfile/test.txt

Alas, I can't seem to find any output file from this, so my excitement at a
lack of an error message was premature.

Then I noticed the -o (--output flag) and tried:

./gpg -r -e /pathtosillyfile/test.txt -o /pathtosillyfile/secret.txt

which apparently is an invalid combination...

So, where is my intuitive kick-the-tires approach going wrong, and what
concept[s] do I need to wrap my brain around?

I understand the basics behind psuedo-random prime number driven
encryption, more or less, from courses long, long ago, and even ported an
example RSA encryptor through a Lisp compiler upgrade a few years back.
Some word size changed or something, so I had to pick some new prime
numbers. Figuring out that was what was wrong pretty much took me through
the whole thing, though. I understood it well then, but it's a little hazy
now.

I'm not super concerned about password security itself. I can transmit
them by sneaker-net or phone lines, except for the script itself on the
server, which I'll be telneting back and forth... Hmmm. Guess I want a
public encoding password, but a private decoding password, if that is a
possibility in this bewildering array of keys, options, and buzzwords.

Well, I hope all this doesn't sound too stupid, and somebody can point me
in the right direction for understanding all the documentation I've read,
but only understand on a surface level.

THANKS!!!

--
--
-- "TANSTAAFL" Rich lynch@lscorp.com
Re: Lost Newbie [ In reply to ]
Richard Lynch <lynch@lscorp.com> writes:

> ./gpg -r -e /pathtosillyfile/test.txt
>
> Alas, I can't seem to find any output file from this, so my excitement at a
> lack of an error message was premature.

The output file is /pathtosillyfile/test.txt.gpg

It is common for Unix program, not to display messages on success.
You may use the otion "-v" to see some info.

> Then I noticed the -o (--output flag) and tried:
>
> ./gpg -r -e /pathtosillyfile/test.txt -o /pathtosillyfile/secret.txt

./gpg -r -e -o /pathtosillyfile/secret.txt /pathtosillyfile/test.txt


It is not possible to mix options and arguments.

I can't anwer all your other questions, due to a lack of time [I'm
already answering email this morning for 2 hours].

Someone else?


Werner
Re: Lost Newbie [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alright, Ill do my best to try to explain some stuff to you.

To generate a secret/public keypair, run gpg --gen-key

Data that is encrypted with a public key can only be decrypted by the
matching secret key. The secret key is protected by a password, the
public key is not.

So to send your friend a message, you would encrypt your message with his
public key, and he would only be able to decrypt it by having the secret
key and putting in the password to use his secret key.

Gpg is also usefull for signing things. Things that are encrypted with
the secret key can be decrypted with the public key. To sign something, a
hash is taken of the data, and then the hash is encrypted with the secret
key. If someone has your public key, they can first verify that it is from
you by decrypting it, then verify that it hasn't changed by checking the
hash.

A keyring is just a large file that stores keys. You have a public keyring
where you store yours and your friend's public keys. You have a secret
keyring that you keep your secret key on.

You can 'conventionally' encrypt something by using the option 'gpg -c'.
It is encrypted using a passphrase, and does not use public and secret
keys. If the person you send the data to knows that passphrase, they can
decrypt it. This is usually most usefull for encrypting things to
yourself, although you can encrypt things to your own public key in the
same way.

You can add and copy keys to and from your keyring with the 'gpg --import'
and 'gpg --export' option. 'gpg --export-secret-keys' will export secret
keys. This is normally not usefull, but you can generate the key on one
machine then move it to another machine.

Keys can be signed under the 'gpg --edit-key' option. When you sign a
key, you are saying that you are certain that the key belongs to the
person it says it comes from.

Hmm, what else. You have already figured out the -o option it looks like.
- -r just lets you specify the recipient (which public key you encrypt with)
on the command line instead of typing it interactively.

Oh yeah, this is important. By default all data is encrypted in some weird
binary format. If you want to have things appear in ascii text that is
readable, just add the '-a' option.

So if I want to encrypt a message to my friend, sign the message, and do
it in ascii, I type 'gpg -esar myfriend mymsg'. 'man gpg' is a good way
to figure out all the options. The biggest problem you will have is their
is not (yet) a good usable version of gpg that works under windows. I
believe that people are working on it. Remember that gpg is still version
0.4.0 . New versions are released about every week or so. This is still
alpha software. Things break and you sorta need to keep up with this list
to get the full use out of gpg. If you need more functionality, windows
and mac versions, you might want to try pgp for now. pgp is the precursor
to gpg. It does the same thing as gpg, but comes under different
licensing terms. I don't know if the way you want to use it would be
considered 'commercial'. It can be found at www.pgpi.con and www.pgp.com
which sends you to www.na.com I believe.

Hope you are able to get something working. If you have anymore questions
let me know.

Kirk Fort

-----BEGIN PGP SIGNATURE-----
Version: GNUPG v0.4.0 (FreeBSD)
Comment: Get GNUPG from ftp://ftp.guug.de/pub/gcrypt/

iEYEARECAAYFAjYLjl4ACgkQf+niZZlBRVOIygCeNyxsmOldoya7kH3zkruKwqhdzoIAn0Kh
XW0OcNkcN+HhDosy4oX1CF6r
=5raZ
-----END PGP SIGNATURE-----
Re: Lost Newbie [ In reply to ]
wk@isil.d.shuttle.de (Werner Koch) writes:
>
> ./gpg -r -e -o /pathtosillyfile/secret.txt /pathtosillyfile/test.txt
>
>
> It is not possible to mix options and arguments.

My two cents on what this means:

If you do a "gpg --help", you will get two separate lists. The first is a list
of commands. The second is a list of options. Whenever you run GPG, you *must*
pick exactly one command (**with one exception, see below). You *may* pick one
or more options. The command must, in general, come at the end of the
argument list, after all the options. If the command takes a file (all the
basic ones do), that the filename comes at the very end. So the basic way to
run gpg is:

gpg [--option something] [--option2] [--option3 something] --command file

Some options take arguments, for example the --output option (which can be
abbreviated -o) is an option which takes a filename. The option's argument
must follow immediately after the option itself: otherwise gpg doesn't know
which option the argument is supposed to go with. As an option, --output and
its filename must come before the command. The --remote-user (-r) option takes
a name or keyid to encrypt the message to, which must come right after the -r
argument. The --encrypt (or -e) command comes after all the options, followed
by the file you wish to encrypt. So use:

gpg -r alice -o secret.txt -e test.txt

If you write the options out in full, it is easier to read:

gpg --remote-user alice --output secret.txt --encrypt test.txt

If you're saving it in a file called ".txt" then you'd probably expect to see
ascii-armored text in there, so you need to add the --armor (-a) option,
which doesn't take any arguments:

gpg --armor --remote-user alice --output secret.txt --encrypt test.txt

If you imagine square brackets around the optional parts, it becomes a bit
clearer:

gpg [--armor] [--remote-user alice] [--output secret.txt] --encrypt test.txt

The optional parts can be rearranged any way you want:

gpg --output secret.txt --remote-user alice --armor --encrypt test.txt



** the exception: signing and encrypting at the same time. Use

gpg [--options] --sign --encrypt foo.txt


hope this helps,
-Brian
warner@lothar.com
Re: Lost Newbie [ In reply to ]
At 8:36 AM 9/25/98, Kirk Fort wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Alright, Ill do my best to try to explain some stuff to you.

I'm doing my best to understand it all, but it ain't enough.

>To generate a secret/public keypair, run gpg --gen-key

My elation at having a menu was dashed by my inability to understand which
choice was best for my particular application.

I guessed 3), since I don't think I need the stuff to be signed. I'm
sending an online order to be run through a credit card machine at my
client's real-life store. I suppose somebody could try to prank somebody
else by ordering coffee or CDs for them, but since there's no profit in it
to the forger, I'm currently not worried about it. Y'all will probably
rain on my parade real soon in this matter, though. :-)

Then I put in my client's name, e-mail, and a comment. Whoo Hooo. I seem
to have generated a key and a secret key. Damned if I know what the
difference is or how to use them, though.

>Data that is encrypted with a public key can only be decrypted by the
>matching secret key. The secret key is protected by a password, the
>public key is not.
>
>So to send your friend a message, you would encrypt your message with his
>public key, and he would only be able to decrypt it by having the secret
>key and putting in the password to use his secret key.

Sounds good. 'Cept I'm unclear on the difference between a password and a
secret key... Why does he need both? Not a big deal: I just don't get
it.

I got as far as trying to ASCII encrypt a file, and then I got this:

[chatmus@ruby gpg]$ ./gpg -vae /home/c/h/chatmus/test.txt
gpg (GNUPG) 0.3.5; Copyright (C) 1998 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

gpg: Warning: using insecure memory!
gpg: this is a PGP generated ElGamal key which is NOT secure for signatures!
gpg: key 812E70CE, uid 2640: invalid self-signature: Unknown pubkey algorithm
gpg: key 812E70CE, uid 2640: invalid user id - removed
gpg: key 812E70CE: no user ids - rejected
gpg: key 812E70CE: can't put it into the trustdb
gpg: failed to initialize the TrustDB: Bad certificate
You did not specify a user ID. (you may use "-r")

Enter the user ID: Michael Cameron
gpg: this is a PGP generated ElGamal key which is NOT secure for signatures!
gpg: key 812E70CE, uid 2640: invalid self-signature: Unknown pubkey algorithm
gpg: key 812E70CE, uid 2640: invalid user id - removed
gpg: key 812E70CE: no user ids - rejected
gpg: key 812E70CE: insert trust record failed: Bad certificate
gpg: this is a PGP generated ElGamal key which is NOT secure for signatures!
gpg: key 812E70CE, uid 2640: invalid self-signature: Unknown pubkey algorithm
gpg: key 812E70CE, uid 2640: invalid user id - removed
gpg: key 812E70CE: no user ids - rejected
gpg: failed to insert it into the trustdb: Bad certificate
It is NOT certain that the key belongs to its owner.
If you *really* know what you are doing, you may answer
the next question with yes

Use this key anyway? y
gpg: reading from '/home/c/h/chatmus/test.txt'
gpg: writing to '/home/c/h/chatmus/test.txt.asc'

gpg: Ooops: Ohhhh jeeee ... (pkclist.c:538:select_algo_from_prefs)
secmem usage: 1472/1472 bytes in 3/3 blocks of pool 1472/16384
Aborted

Why do I get the idea that I've found a bug, or I'm just doing something
that nobody who knew what they were doing would try? :-)

What's with the "insecure memory"? Can I make it secure? Or should I not
worry? Or what?

And how come it doesn't know who owns the key?
Is it because:
A) I need to specify the client's name (or some other id)
B) I didn't pick one of the "sign and encrypt" options.

>You can 'conventionally' encrypt something by using the option 'gpg -c'.
>It is encrypted using a passphrase, and does not use public and secret
>keys. If the person you send the data to knows that passphrase, they can
>decrypt it. This is usually most usefull for encrypting things to
>yourself, although you can encrypt things to your own public key in the
>same way.

That pretty much just hung. :-(

[chatmus@ruby gpg]$ ./gpg -c
gpg (GNUPG) 0.3.5; Copyright (C) 1998 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

gpg: Warning: using insecure memory!
gpg: this is a PGP generated ElGamal key which is NOT secure for signatures!
gpg: key 812E70CE, uid 2640: invalid self-signature: Unknown pubkey algorithm
gpg: key 812E70CE, uid 2640: invalid user id - removed
gpg: key 812E70CE: no user ids - rejected
gpg: key 812E70CE: can't put it into the trustdb
gpg: failed to initialize the TrustDB: Bad certificate
›$#created by GNUPG v0.3.5 (GNU/Linux)

yu


Had to break.

>You can add and copy keys to and from your keyring with the 'gpg --import'
>and 'gpg --export' option. 'gpg --export-secret-keys' will export secret
>keys. This is normally not usefull, but you can generate the key on one
>machine then move it to another machine.
>
>Keys can be signed under the 'gpg --edit-key' option. When you sign a
>key, you are saying that you are certain that the key belongs to the
>person it says it comes from.
>
>Hmm, what else. You have already figured out the -o option it looks like.
>- -r just lets you specify the recipient (which public key you encrypt with)
>on the command line instead of typing it interactively.
>
>Oh yeah, this is important. By default all data is encrypted in some weird
>binary format. If you want to have things appear in ascii text that is
>readable, just add the '-a' option.

*THAT* one I understand. YAY!

>So if I want to encrypt a message to my friend, sign the message, and do
>it in ascii, I type 'gpg -esar myfriend mymsg'. 'man gpg' is a good way
>to figure out all the options. The biggest problem you will have is their

My ISP host chose not to put the gpg man pages in... Where are they. I
looked, but failed to find them.

>is not (yet) a good usable version of gpg that works under windows. I
>believe that people are working on it. Remember that gpg is still version
>0.4.0 . New versions are released about every week or so. This is still
>alpha software. Things break and you sorta need to keep up with this list
>to get the full use out of gpg. If you need more functionality, windows
>and mac versions, you might want to try pgp for now. pgp is the precursor
>to gpg. It does the same thing as gpg, but comes under different
>licensing terms. I don't know if the way you want to use it would be
>considered 'commercial'. It can be found at www.pgpi.con and www.pgp.com
>which sends you to www.na.com I believe.

I already checked with those folks, and while they were willing to cut the
price way down... it wasn't low enough to make it worthwhile to my client.
We don't expect high volume. :-(

>Hope you are able to get something working. If you have anymore questions
>let me know.

Well, I've certainly done that. :-)

THANKS!!!

PS Is somebody working on an "Introduction" yet?
It ain't much, but I reckon I could try to start one.

--
--
-- "TANSTAAFL" Rich lynch@lscorp.com
Re: Lost Newbie [ In reply to ]
At 8:36 AM 9/25/98, Kirk Fort wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Alright, Ill do my best to try to explain some stuff to you.

I'm doing my best to understand it all, but it ain't enough.

>To generate a secret/public keypair, run gpg --gen-key

My elation at having a menu was dashed by my inability to understand which
choice was best for my particular application.

I guessed 3), since I don't think I need the stuff to be signed. I'm
sending an online order to be run through a credit card machine at my
client's real-life store. I suppose somebody could try to prank somebody
else by ordering coffee or CDs for them, but since there's no profit in it
to the forger, I'm currently not worried about it. Y'all will probably
rain on my parade real soon in this matter, though. :-)

Then I put in my client's name, e-mail, and a comment. Whoo Hooo. I seem
to have generated a key and a secret key. Damned if I know what the
difference is or how to use them, though.

>Data that is encrypted with a public key can only be decrypted by the
>matching secret key. The secret key is protected by a password, the
>public key is not.
>
>So to send your friend a message, you would encrypt your message with his
>public key, and he would only be able to decrypt it by having the secret
>key and putting in the password to use his secret key.

Sounds good. 'Cept I'm unclear on the difference between a password and a
secret key... Why does he need both? Not a big deal: I just don't get
it.

I got as far as trying to ASCII encrypt a file, and then I got this:

[chatmus@ruby gpg]$ ./gpg -vae /home/c/h/chatmus/test.txt
gpg (GNUPG) 0.3.5; Copyright (C) 1998 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

gpg: Warning: using insecure memory!
gpg: this is a PGP generated ElGamal key which is NOT secure for signatures!
gpg: key 812E70CE, uid 2640: invalid self-signature: Unknown pubkey algorithm
gpg: key 812E70CE, uid 2640: invalid user id - removed
gpg: key 812E70CE: no user ids - rejected
gpg: key 812E70CE: can't put it into the trustdb
gpg: failed to initialize the TrustDB: Bad certificate
You did not specify a user ID. (you may use "-r")

Enter the user ID: Michael Cameron
gpg: this is a PGP generated ElGamal key which is NOT secure for signatures!
gpg: key 812E70CE, uid 2640: invalid self-signature: Unknown pubkey algorithm
gpg: key 812E70CE, uid 2640: invalid user id - removed
gpg: key 812E70CE: no user ids - rejected
gpg: key 812E70CE: insert trust record failed: Bad certificate
gpg: this is a PGP generated ElGamal key which is NOT secure for signatures!
gpg: key 812E70CE, uid 2640: invalid self-signature: Unknown pubkey algorithm
gpg: key 812E70CE, uid 2640: invalid user id - removed
gpg: key 812E70CE: no user ids - rejected
gpg: failed to insert it into the trustdb: Bad certificate
It is NOT certain that the key belongs to its owner.
If you *really* know what you are doing, you may answer
the next question with yes

Use this key anyway? y
gpg: reading from '/home/c/h/chatmus/test.txt'
gpg: writing to '/home/c/h/chatmus/test.txt.asc'

gpg: Ooops: Ohhhh jeeee ... (pkclist.c:538:select_algo_from_prefs)
secmem usage: 1472/1472 bytes in 3/3 blocks of pool 1472/16384
Aborted

Why do I get the idea that I've found a bug, or I'm just doing something
that nobody who knew what they were doing would try? :-)

What's with the "insecure memory"? Can I make it secure? Or should I not
worry? Or what?

And how come it doesn't know who owns the key?
Is it because:
A) I need to specify the client's name (or some other id)
B) I didn't pick one of the "sign and encrypt" options.

>You can 'conventionally' encrypt something by using the option 'gpg -c'.
>It is encrypted using a passphrase, and does not use public and secret
>keys. If the person you send the data to knows that passphrase, they can
>decrypt it. This is usually most usefull for encrypting things to
>yourself, although you can encrypt things to your own public key in the
>same way.

That pretty much just hung. :-(

[chatmus@ruby gpg]$ ./gpg -c
gpg (GNUPG) 0.3.5; Copyright (C) 1998 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

gpg: Warning: using insecure memory!
gpg: this is a PGP generated ElGamal key which is NOT secure for signatures!
gpg: key 812E70CE, uid 2640: invalid self-signature: Unknown pubkey algorithm
gpg: key 812E70CE, uid 2640: invalid user id - removed
gpg: key 812E70CE: no user ids - rejected
gpg: key 812E70CE: can't put it into the trustdb
gpg: failed to initialize the TrustDB: Bad certificate
›$#created by GNUPG v0.3.5 (GNU/Linux)

yu


Had to break.

>You can add and copy keys to and from your keyring with the 'gpg --import'
>and 'gpg --export' option. 'gpg --export-secret-keys' will export secret
>keys. This is normally not usefull, but you can generate the key on one
>machine then move it to another machine.
>
>Keys can be signed under the 'gpg --edit-key' option. When you sign a
>key, you are saying that you are certain that the key belongs to the
>person it says it comes from.
>
>Hmm, what else. You have already figured out the -o option it looks like.
>- -r just lets you specify the recipient (which public key you encrypt with)
>on the command line instead of typing it interactively.
>
>Oh yeah, this is important. By default all data is encrypted in some weird
>binary format. If you want to have things appear in ascii text that is
>readable, just add the '-a' option.

*THAT* one I understand. YAY!

>So if I want to encrypt a message to my friend, sign the message, and do
>it in ascii, I type 'gpg -esar myfriend mymsg'. 'man gpg' is a good way
>to figure out all the options. The biggest problem you will have is their

My ISP host chose not to put the gpg man pages in... Where are they. I
looked, but failed to find them.

>is not (yet) a good usable version of gpg that works under windows. I
>believe that people are working on it. Remember that gpg is still version
>0.4.0 . New versions are released about every week or so. This is still
>alpha software. Things break and you sorta need to keep up with this list
>to get the full use out of gpg. If you need more functionality, windows
>and mac versions, you might want to try pgp for now. pgp is the precursor
>to gpg. It does the same thing as gpg, but comes under different
>licensing terms. I don't know if the way you want to use it would be
>considered 'commercial'. It can be found at www.pgpi.con and www.pgp.com
>which sends you to www.na.com I believe.

I already checked with those folks, and while they were willing to cut the
price way down... it wasn't low enough to make it worthwhile to my client.
We don't expect high volume. :-(

>Hope you are able to get something working. If you have anymore questions
>let me know.

Well, I've certainly done that. :-)

THANKS!!!

PS Is somebody working on an "Introduction" yet?
It ain't much, but I reckon I could try to start one.

--
--
-- "TANSTAAFL" Rich lynch@lscorp.com
Re: Lost Newbie [ In reply to ]
On Sat, Sep 26, 1998 at 08:35:05PM -0500, Richard Lynch wrote:
> At 8:36 AM 9/25/98, Kirk Fort wrote:
> >-----BEGIN PGP SIGNED MESSAGE-----
> >Hash: SHA1
> >
> >Alright, Ill do my best to try to explain some stuff to you.
>
> I'm doing my best to understand it all, but it ain't enough.

PK crypto is cool though. :)

> >To generate a secret/public keypair, run gpg --gen-key
>
> My elation at having a menu was dashed by my inability to understand which
> choice was best for my particular application.

When in doubt, take the default. 1 will do.

> I guessed 3), since I don't think I need the stuff to be signed. I'm
> sending an online order to be run through a credit card machine at my
> client's real-life store. I suppose somebody could try to prank somebody
> else by ordering coffee or CDs for them, but since there's no profit in it
> to the forger, I'm currently not worried about it. Y'all will probably
> rain on my parade real soon in this matter, though. :-)

Well, it won't hurt, but 1 is better. You will want to sign things...
the first thing you'll want to sign is your key. (Don't trust a key
that even the owner isn't willing to sign.)

> Then I put in my client's name, e-mail, and a comment. Whoo Hooo. I seem
> to have generated a key and a secret key. Damned if I know what the
> difference is or how to use them, though.

But look here:

> >Data that is encrypted with a public key can only be decrypted by the
> >matching secret key. The secret key is protected by a password, the
> >public key is not.
> >
> >So to send your friend a message, you would encrypt your message with his
> >public key, and he would only be able to decrypt it by having the secret
> >key and putting in the password to use his secret key.
>
> Sounds good. 'Cept I'm unclear on the difference between a password and a
> secret key... Why does he need both? Not a big deal: I just don't get
> it.

The password is only part of the secret key. The real secret key is a
combination of the password and the one on the 'secring.gpg'. This, in
effect, lets you have far more secure passwords than just a dozen or two
characters.

> I got as far as trying to ASCII encrypt a file, and then I got this:
>
> [chatmus@ruby gpg]$ ./gpg -vae /home/c/h/chatmus/test.txt
> gpg: this is a PGP generated ElGamal key which is NOT secure for signatures!
> gpg: key 812E70CE, uid 2640: invalid self-signature: Unknown pubkey algorithm
> gpg: key 812E70CE, uid 2640: invalid user id - removed
> gpg: key 812E70CE: no user ids - rejected
> gpg: key 812E70CE: can't put it into the trustdb

It doesn't like your key since it can't be signed..... since you don't
have a secure way to sign it.

Go back and generate a sign/encrypt key. They are useful. (And you
never know when you may need to sign things: if I can get the Internic
to take my GPG key, I'll switch to PGP checking on all our stuff, which
will make me feel better at night...)

> gpg: Ooops: Ohhhh jeeee ... (pkclist.c:538:select_algo_from_prefs)
> secmem usage: 1472/1472 bytes in 3/3 blocks of pool 1472/16384

Well, that looks like a bug. :)
>
> Why do I get the idea that I've found a bug, or I'm just doing something
> that nobody who knew what they were doing would try? :-)
>
> What's with the "insecure memory"? Can I make it secure? Or should I not
> worry? Or what?

Set gpg to be setuid root and you can. (This keeps other processes from
snooping your memory to steal your data while it's there: it's not
absolutely critical, but paranoia is a good thing.)

I gather you're not root on this machine, so it may not be possible, but
I wouldn't stay up late worrying about it.

> And how come it doesn't know who owns the key?
> Is it because:
> A) I need to specify the client's name (or some other id)
> B) I didn't pick one of the "sign and encrypt" options.

B)

> PS Is somebody working on an "Introduction" yet?
> It ain't much, but I reckon I could try to start one.

Actually, that would be really useful. The more people know how to use
and recognize a signature, the better.

--
Brian Moore | "The Zen nature of a spammer resembles
Sysadmin, C/Perl Hacker | a cockroach, except that the cockroach
Usenet Vandal | is higher up on the evolutionary chain."
Netscum, Bane of Elves. Peter Olson, Delphi Postmaster
Re: Lost Newbie [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, 26 Sep 1998, Richard Lynch wrote:

> My elation at having a menu was dashed by my inability to understand which
> choice was best for my particular application.

I don't understand the little differences between the different types of
keys, but if I were you, I would choose the default.

> Then I put in my client's name, e-mail, and a comment. Whoo Hooo. I seem
> to have generated a key and a secret key. Damned if I know what the
> difference is or how to use them, though.

You have a public key, and a secret key. What is encrypted with the
public key can only be decrypted with the secret key. What is encrypted
with the secret key can only be decrypted by the public key.

> >So to send your friend a message, you would encrypt your message with his
> >public key, and he would only be able to decrypt it by having the secret
> >key and putting in the password to use his secret key.
>
> Sounds good. 'Cept I'm unclear on the difference between a password and a
> secret key... Why does he need both? Not a big deal: I just don't get
> it.

You put a password on the secret key for added security. If anyone had
access to the secret key and it did not have a password on it, they could
encrypt and decrypt with it. If you really want to I suppose that you
could leave a password off of the secret key. Usually this is not a good
idea.

> I got as far as trying to ASCII encrypt a file, and then I got this:
>
> [chatmus@ruby gpg]$ ./gpg -vae /home/c/h/chatmus/test.txt
> gpg (GNUPG) 0.3.5; Copyright (C) 1998 Free Software Foundation, Inc.
> This program comes with ABSOLUTELY NO WARRANTY.
> This is free software, and you are welcome to redistribute it
> under certain conditions. See the file COPYING for details.

First thing you need to do is upgrade to 0.4.0 . 0.3.5 has a major bug
which makes it basically useless. 0.4.0 has a minor bug, so you should
apply the hotfix which was posted to this list several days ago. Your
sysop needs to read this list. gpg is alpha software that changes daily.

> gpg: Warning: using insecure memory!

The gpg program needs to have the suid bit set in order to use secure
memory. Usually this means something like 'chmod 4755 /usr/local/bin/gpg'.
Your sysop should know how to do this.

> gpg: this is a PGP generated ElGamal key which is NOT secure for signatures!
> gpg: key 812E70CE, uid 2640: invalid self-signature: Unknown pubkey algorithm
> gpg: key 812E70CE, uid 2640: invalid user id - removed
> gpg: key 812E70CE: no user ids - rejected
> gpg: key 812E70CE: can't put it into the trustdb
> gpg: failed to initialize the TrustDB: Bad certificate

I don't have much of a clue about all of this stuff. Anyone else??
I'm pretty sure it has something to do with the option you chose when you
generated your key. I think what the trouble is that the key isn't self
signed because you chose an option that can't sign. Go with the default
option to generate your key. You can delete your key with 'gpg
- --delete-secret-key Cameron' (Michael Cameron is the id on it, right?) and
'gpg --delete-key Cameron' . Run gpg --gen-key again and choose option 1.

> You did not specify a user ID. (you may use "-r")
>
> Enter the user ID: Michael Cameron

> gpg: Ooops: Ohhhh jeeee ... (pkclist.c:538:select_algo_from_prefs)
> secmem usage: 1472/1472 bytes in 3/3 blocks of pool 1472/16384
> Aborted

> Why do I get the idea that I've found a bug, or I'm just doing something
> that nobody who knew what they were doing would try? :-)

Probably a bug of somesort. I'm not really sure what all of your errors
mean.

> B) I didn't pick one of the "sign and encrypt" options.
I think so

> [chatmus@ruby gpg]$ ./gpg -c
> gpg (GNUPG) 0.3.5; Copyright (C) 1998 Free Software Foundation, Inc.
> This program comes with ABSOLUTELY NO WARRANTY.
> This is free software, and you are welcome to redistribute it
> under certain conditions. See the file COPYING for details.
>
> gpg: Warning: using insecure memory!
> gpg: this is a PGP generated ElGamal key which is NOT secure for signatures!
> gpg: key 812E70CE, uid 2640: invalid self-signature: Unknown pubkey algorithm
> gpg: key 812E70CE, uid 2640: invalid user id - removed
> gpg: key 812E70CE: no user ids - rejected
> gpg: key 812E70CE: can't put it into the trustdb
> gpg: failed to initialize the TrustDB: Bad certificate
> ›$#created by GNUPG v0.3.5 (GNU/Linux)
>
> yu
> ]Š
>
> Had to break.
You got the same errors you got before about the key. Then it waited for
the standard input. You need to specify a file to encrypt on the command
line. Or you can use the '-o' option on the command line and type what
you want to be encrypted into gpg then end it with a ^d .

> My ISP host chose not to put the gpg man pages in... Where are they. I
> looked, but failed to find them.
Ask your sysop

> PS Is somebody working on an "Introduction" yet?
> It ain't much, but I reckon I could try to start one.

I think someone is working on more documentation but I don't really know.
Remember that this is alpha software so alot of your documentation right
now is the mailing list and the change logs.

Kirk Fort
-----BEGIN PGP SIGNATURE-----
Version: GNUPG v0.4.0 (FreeBSD)
Comment: Get GNUPG from ftp://ftp.guug.de/pub/gcrypt/

iEYEARECAAYFAjYNobsACgkQf+niZZlBRVPSmgCeP3q8vvVtCgfaPBR6fYjAWLzDKlwAnilc
5eXNMeUK+J7TBqeY9qliO1Co
=c99C
-----END PGP SIGNATURE-----
Re: Lost Newbie [ In reply to ]
Kirk Fort <kfort@kfort.dyn.ml.org> writes:

> encrypt and decrypt with it. If you really want to I suppose that you
> could leave a password off of the secret key. Usually this is not a good

And the next version will bother you with warning :-)

> > gpg: this is a PGP generated ElGamal key which is NOT secure for signatures!

Strange. Who has generated this key?? I'd like to see this public
key. Maybe an ElGamal secondary key was used for signing; this would
be a bug.

> > gpg: key 812E70CE, uid 2640: invalid self-signature: Unknown pubkey algorithm

RSA used.

> generated your key. I think what the trouble is that the key isn't self
> signed because you chose an option that can't sign. Go with the default

Or it is self-signed and not valid (see the above error).

> > gpg: Ooops: Ohhhh jeeee ... (pkclist.c:538:select_algo_from_prefs)

I'll change this message to something like "You found a bug!"

> > secmem usage: 1472/1472 bytes in 3/3 blocks of pool 1472/16384

This is a memory statistic.


Werner
Re: Lost Newbie [ In reply to ]
I've staggered a little further along, but I seem to have hit a stumbling
block. I created a key for my client on my keyring. I encrypted a test
message, and it sure 'nuf was a whole mess of seemingly random ASCII
characters. I even managed to decrypt it back to the original. Whooo
Hooooo!!!

Then I got cocky and decided to make another key for myself-- or, rather,
one of my "selves" -- as webmaster@uncommonground.com And, since I'm not
too concerned about somebody forging messages, and I can't quickly figure
out how to securely get a passphrase from a PHP script (kinda like Perl
only readable) to the gpg program, I figured I'd use no passphrase.

I thought I could use -r to specify which key to use to encrypt. But no
matter what I do, gpg's asking my for my client's passphrase...

So I go digging through your generous e-mails, and find:

Brian Warner wrote:
>The --remote-user (-r) option takes
>a name or keyid to encrypt the message to, which must come right after the -r
>argument.

So, apparently -r is to specify the recipient of the message. Is it
possible to specify the sender?... Or am I even more confused than I think
I am.

I was rather hoping to use the key ring to store multiple personalities I
use. webmaster@uncommonground.com, webmaster@jademaze.com,
webmaster@astrakelly.com, webmaster@olivierledoux.com,
lynch@cognitivearts.com, etc...

Is that possible? I'm not seeing anything obvious in -h about the from user.

If not, of the keyrings I've made, how does it decide which one is "me"
(the sender)? Is it just the first one I made, or the most secure one it
can find, or...?...

I'm still on v0.3.5 'cuz I haven't bothered my ISP to recompile yet... so
if -r is just behaving oddly because of that... sorry.

THANKS!!!

--
--
-- "TANSTAAFL" Rich lynch@lscorp.com
Re: Lost Newbie [ In reply to ]
lynch@lscorp.com (Richard Lynch) writes:
> So, apparently -r is to specify the recipient of the message. Is it
> possible to specify the sender?... Or am I even more confused than I think
> I am.
>
> I was rather hoping to use the key ring to store multiple personalities I
> use. webmaster@uncommonground.com, webmaster@jademaze.com,
> webmaster@astrakelly.com, webmaster@olivierledoux.com,
> lynch@cognitivearts.com, etc...
>
> Is that possible? I'm not seeing anything obvious in -h about the from user.

Just use --local-user (short form "-u"). This specifies the userid for use in
signing or decrypting. If you have multiple keys with the same email address,
you'll need something else to distinguish them (e.g., if you used "-u
webmaster" you'd probably just get the first such key on your ring. use
--list-keys "id" to test out what ids will get what). If all else fails, use
the hex keyid displayed during --list-secret-keys, like:

gpg --encrypt -r dest1 -r dest2 -u 0xd139cc4c file

> If not, of the keyrings I've made, how does it decide which one is "me"
> (the sender)? Is it just the first one I made, or the most secure one it
> can find, or...?...

Not sure. My guess is the first one listed in your secret keyring.


hope this helps,
-Brian
warner@lothar.com
Re: Lost Newbie [ In reply to ]
Brian Warner <warner@lothar.com> writes:

> > If not, of the keyrings I've made, how does it decide which one is "me"
> > (the sender)? Is it just the first one I made, or the most secure one it
> > can find, or...?...
>
> Not sure. My guess is the first one listed in your secret keyring.

Right. Or the one you set with "default-key keyid-or-name" in your
options file.


Werner


[.Brian, ist possible for you to change the "To:" address
"lothar-mail-g10@" to "g10net.lut.ac.uk"? It breaks Mutt's ML feature]
Re: Lost Newbie [ In reply to ]
Richard Lynch <lynch@lscorp.com> writes:

> I was rather hoping to use the key ring to store multiple personalities I
> use. webmaster@uncommonground.com, webmaster@jademaze.com,
> webmaster@astrakelly.com, webmaster@olivierledoux.com,
> lynch@cognitivearts.com, etc...

Why don't you use alternate user ids for this?

> I'm still on v0.3.5 'cuz I haven't bothered my ISP to recompile yet... so
> if -r is just behaving oddly because of that... sorry.

PLEASE: Tell your ISP to remove gnupg if he can't switch to 0.4.0!!!!!

And I don't think it is a good idea to use gnupg on a remote
machine and store the secret keyring there. If you are only doing
this for test purposes (Say you don't have a Unix box on your desk),
please mark your keys with a comment TEST, INSECURE or EVALUATION.

Nobody would trust any of your keysignatures if you don't have control
over your secret keyring.


Werner