/    Sign up×
Community /Pin to ProfileBookmark

PGP GPG Encryption

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:

[FONT=”Courier New”]
putenv(“GNUPGHOME=/home/username/.gnupg”);
$command = ‘gpg -e -r [email][email protected][/email] sample.txt’;
system($command, $result);
[/FONT]

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:

[FONT=”Courier New”]
A8E96BFE [1024D] Sample Name ([email protected])
[/FONT]

And from this, i replaced the gpg command to:

[FONT=”Courier New”]
$command = ‘gpg -e -r [email][email protected][/email] sample.txt’;
[/FONT]

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 ?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@Phill_PaffordJun 19.2008 — What user is running the command, is it a script and does the script have permission to execute the GPG/PGP script.
×

Success!

Help @redsword7 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...