Skip to content
Encrypt/decrypt PGP messages with PHP
Latest commit 0348ae4 Jun 19, 2016 @alecpl alecpl Prepare release
Failed to load latest commit information.
Crypt Fix code style errors, add some method docs Jun 17, 2016
data More work on the pinentry. Clean up CLI, use Console_CommandLine. Cle… Feb 22, 2013
tests Feature #21079: Added Crypt_GPG::exportPrivateKey() method Jun 16, 2016
tools Tool to dump keyring state to PHP. Used for unit test generation. Feb 19, 2009
.gitignore make tests run on Aug 14, 2015
.travis.yml make tests run on Aug 14, 2015
LICENSE Fix some whitespace Jun 4, 2016 Mark code in as such Apr 17, 2016
package.php Update changelog for the next release Jun 17, 2016
package.xml Prepare release Jun 19, 2016


Crypt_GPG is a PHP package to interact with the GNU Privacy Guard (GnuPG). GnuPG is a free and open-source implementation of the OpenPGP protocol, providing key management, data encryption and data signing. Crypt_GPG provides an object-oriented API for performing OpenPGP actions using GnuPG.

Crypt_GPG has been migrated from PEAR SVN.


Quick Example


require_once 'Crypt/GPG.php';

$gpg = new Crypt_GPG();
$data = $gpg->encrypt('my secret data');


Further Documentation

Bugs and Issues

Please report all new issues via the PEAR bug tracker.

Please submit pull requests for your bug reports!


To test, run either $ phpunit tests/ or $ pear run-tests -r


To build, simply $ pear package


To install from scratch $ pear install package.xml

To upgrade $ pear upgrade -f package.xml

Something went wrong with that request. Please try again.