Re: [PHP] GnuPG from PHP - Where is the include ??

2011-05-24 Thread Stuart Dallas
On Tue, May 24, 2011 at 8:41 PM, Eli Orr (Office)  wrote:
> Please advise - I'guess it is not a build in and looking for the GnuPG PHP
> include as
> all the GnuPG functions are now considered undefined.

http://php.net/gnupg.installation

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] GnuPG from PHP - Where is the include ??

2011-05-24 Thread Eli Orr (Office)
Please advise - I'guess it is not a build in and looking for the GnuPG 
PHP include as

all the GnuPG functions are now considered undefined.

See below.

Thanks

Eli

//  GnuPG from PHP - Where is the include ??
//  http://www.gnupg.org/gph/en/manual.html
//  http://www.gnupg.org/documentation/howtos.en.html
//  GnuPG allows to encrypt and sign your data and communication,
//  features a versatile key management system as well as access
//  modules for all kinds of public key directories.
//

echo "GNU Encrypt with agreed secret key between sides.";

$secret_key = "8660281B6051D071D94B5B230549F9DC851566DC"; // Only shared 
parties know this
$the_secret_content  = "this is a very secret XML keep the secret key in 
the server and client well hidden from 4rd parties"; // Only shared 
parties know this


echo "Secret Key between Parties: [$secret_key] ";
echo "The sensitive content to keep safe 
 from 3rd parties:  $the_secret_content ";


//Creating the encryption content
$res = gnupg_init();
gnupg_addencryptkey($res, $secret_key);
$enc = gnupg_encrypt($res, $the_secret_content);
echo "This is the sensitive content encrypted by strong shared secret 
key:[".$enc."] ";


echo "Secret Key between Parties: [$secret_key] ";

 $res = gnupg_init();
gnupg_adddecryptkey($res,$secret_key);
$plain = gnupg_decrypt($res, $enc);

echo "This is the sensitive content decrypted by recieving party 
 that has the shared secret key:[".$plain."] ";

_

_