PDA

View Full Version : PGP GPG Encryption



redsword7
19 Jun 2008, 08:01 AM
Hello everybody,

Im new to PGP or GPG (GnuPG), can anyone there help me with my problem.
This is the situation. I've generated a key pair from the OpenPGP Section in my cpanel and there was a public and private key generated, i used the command:


putenv("GNUPGHOME=/home/username/.gnupg");
$command = 'gpg -e -r user@email.com sample.txt';
system($command, $result);


and it works fine, it provides me an encrypted file sample.txt.gpg.
But when I imported a separate public key, there appears in the public key section something like this:


A8E96BFE [1024D] Sample Name (sample@samplename.com)


And from this, i replaced the gpg command to:


$command = 'gpg -e -r sample@samplename.com sample.txt';


and from this case, it doesn't encrypt the file anymore. Is there any other code or gpg command I could use with the imported public key to properly encrypt the file.

Thanks,

Red :)