GnuPG is open-source software that makes it possible to encrypt your email and other messages so that they can only be read by the intended recipient (not unlike Jim Phelps and his briefing book). Unlike cleartext messages, which are unprotected and can be read by anyone who intercepts them, GnuPG-encrypted messages are “locked” through cryptographic techniques and may be viewed only by a person with the correct “key”; everyone else will merely see gibberish. In today’s day and age, when hacking and phishing is common, such encryption plays an important role in protecting sensitive data like user names, passwords or credit-card information.
Using GnuPG with PHP
Encryption and Decryption using PHP and GnuPG
Since almost the beginning of time, it seems, man has had a need to keep information private and, in many situations, needed to decipher
information previously made private by others. In our age of high technology these needs have grown exponentially and become more complex.
In the past, the ability to encrypt information with relative strength could be found only in the realms of governments. Thanks to a gentleman named Phil Zimmerman, this ability has been brought to the masses. In 1991 Mr. Zimmerman invented Pretty Good Privacy or PGP for short. PGP was designed to be high-grade encryption software available for free to anyone who wished to use it.
One of the major aspects of PGP is that it utilizes “Public-Key Encryption”. In a nutshell, that means that you actually have two
keys: a Private Key that only you should have access to and a Public Key that you give away to anyone you want. When someone wants to send you an encrypted file, they use your Public Key to encrypt the file. Having done that, the encrypted file can then only be decrypted by you using your Private Key.
One way to think of Public-Key Encryption is someone sending you a snail mail letter in an envelope that only you can open. Anyone can see the envelope but only you can read its contents.
Because of the US Government’s restrictions on exporting high-grade encryption technology, giving PGP to people outside the US was illegal. Because of this a team of programmers lead by Werner Koch in Germany took it upon themselves to write an Open Source, RFC2440 (OpenPGP) alternative to PGP called GNU Privacy Guard, or GnuPG. Because GnuPG was developed outside of the US the export restrictions didn’t apply. It should be noted that PGP and GnuPG are virtually identical (with
a few exceptions) so, in the interest of Open Source and keeping people out of prison, we will be using GnuPG in this article.

