Specifications

To obtain PGP for use outside the USA and Canada, see the list of international download sites
at the international PGP page:
http://www.pgpi.org
An Open Source alternative to PGP has recently become available. GPGGnu Privacy
Guardis a free (as in beer) and Free (as in speech) replacement for PGP. It contains no
patented algorithms, and can be used commercially without restriction.
The two products perform the same task in fairly similar ways. If you intend to use the com-
mand line tools it might not matter, but PGP has other useful interfaces such as plug-ins for
popular email programs that will automatically decrypt email when it is received.
GPG is available from
http://www.gnupg.org
You can use the two products together, creating an encrypted message using GPG for some-
body using PGP (as long as it is a recent version) to decrypt. As it is the creation of messages
at the Web server we are interested in, we will provide an example here using GPG. Using
PGP instead will not require many changes.
As well as the usual requirements for examples in this book, you will need to have GPG avail-
able for this code to work. GPG might already be installed on your system. If it is not, do not
be concerned: The installation procedure is very straightforward, but the setup can be a bit
tricky.
Installing GPG
To add GPG to our Linux machine, we downloaded the appropriate archive file from
www.gnupg.org, and used gunzip and tar to extract the files from the archive.
To compile and install the program, use the same commands as for most Linux programs:
configure (or ./configure depending on your system)
make
make install
If you are not the root user, you will need to run the configure script with the --prefix option
as follows:
./configure --prefix=/path/to/your/directory
This is because a non-root user will not have access to the default directory for GPG.
If all goes well, GPG will be compiled and the executable copied to /usr/local/bin/gpg or
the directory that you specified. You can change many options. See the GPG documentation for
details.
Implementing Secure Transactions with PHP and MySQL
C
HAPTER 15
15
I
MPLEMENTING
S
ECURE
TRANSACTIONS
339
19 7842 CH15 3/6/01 3:40 PM Page 339