[Gllug] gpg - what are the strange characters ?

Alain Williams addw at phcomp.co.uk
Fri Jul 31 09:09:36 UTC 2009


On Wed, Jul 29, 2009 at 01:36:18AM +0100, Alain Williams wrote:
> On Tue, Jul 28, 2009 at 01:49:25AM +0100, Alain Williams wrote:
> > I have been generating GPG keys, when it does it GPG prints out strings of '+.-<>' (see below)
> > 
> > What are these characters, I can see that it is trying to show progress, but what do
> > the different characters mean ?
> ...

If you are all not completely fed up with me by now, I have an answer ...

I have received a pointer from Daniel Kahn Gillmor <dkg at fifthhorseman.net>:

	You can find some documentation of the intended significance of this
	output in the file named DETAILS.  look for the section called "Key
	generation".

On my machine that is /usr/share/doc/gnupg-1.4.5/DETAILS and I have copied the relevant
section here:

****

Key generation
==============
    Key generation shows progress by printing different characters to
    stderr:
             "."  Last 10 Miller-Rabin tests failed
             "+"  Miller-Rabin test succeeded
             "!"  Reloading the pool with fresh prime numbers
             "^"  Checking a new value for the generator
             "<"  Size of one factor decreased
             ">"  Size of one factor increased

    The prime number for Elgamal is generated this way:

    1) Make a prime number q of 160, 200, 240 bits (depending on the keysize)
    2) Select the length of the other prime factors to be at least the size
       of q and calculate the number of prime factors needed
    3) Make a pool of prime numbers, each of the length determined in step 2
    4) Get a new permutation out of the pool or continue with step 3
       if we have tested all permutations.
    5) Calculate a candidate prime p = 2 * q * p[1] * ... * p[n] + 1
    6) Check that this prime has the correct length (this may change q if
       it seems not to be possible to make a prime of the desired length)
    7) Check whether this is a prime using trial divisions and the
       Miller-Rabin test.
    8) Continue with step 4 if we did not find a prime in step 7.
    9) Find a generator for that prime.

    This algorithm is based on Lim and Lee's suggestion from the
    Crypto '97 proceedings p. 260.

****

Although I see, in the code, that these characters are generated in other places also.

Make your head spin here:

	http://en.wikipedia.org/wiki/MillerRabin_primality_test

-- 
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
Past chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h>
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list