Using the PHP-GPG function is very simple. Just grab a copy of one of the two scripts, adjust the appropriate variables at the top:
Then, include the file into the script where you need to use it:
include("./gpg.inc.php");
And then make the call with the appropriate data bits:
$encrypted = gpgit($data, $pgpkeys);
This function takes two arguments:
and returns the encrypted text into the variable you specify ($encrypted)! PGP Keys may be submitted as email addresses or PGP IDs, or a mixture of both. If no valid keys are submitted, the script will exit with an appropriate error and stop there.
PHP FUNCTION FILES
USE THESE SCRIPTS AT YOUR OWN RISK! I make no promises about the security of this script, nor do I guarantee it will work on any platform (or with any given version of GPG). While I have tried to ensure reasonable precautions to make these scripts as stable and secure as I can - you have been warned!
These scripts are open-source and free (no cost). You may do with it what you wish, as long as you leave the copyright data at the top in place.