PGP in PHP?
Posted: Wed Jun 05, 2002 6:04 am
Hi guys and girl,
I'm new here, and I have just started working with PHP. I have this burning question:
I have a website with a form which uses a mailform.php
In this form you can fill in your stuff like name adress, ans also your creditcard number, cause you can buy stuff online.
I have used a PGP script inside my PHP, to encrypt the Creditcard number.
It's running on a Apache server. But we test it on a Xitama.
Locally PGP freeware 7.0.3 has been installed to generate a keyring.
But when the webmaster receives the email, the creditcard number is gone, empty.
This is the code:
_____________________________________________________________
function pgp_encrypt($keyring_location, $public_key_id, $plain_text) {
$key_id = EscapeShellArg($public_key_id);
putenv("PGPPATH=$keyring_location");
// encrypt the message
$pipe = popen("pgpe -r $key_id -af", "r");
fwrite($pipe, $plain_text);
$encrypted_text = '';
while($s = fgets($pipe, 1024)) {
// read from the pipe
$encrypted_text .= $s;
}
pclose($pipe);
return $encrypted_text;
}
$Nummer = pgp_encrypt("/location/pgpkey/", "webmaster@domain.nl", $creditcard);
_____________________________________________________________
Is it because of Xitama server, that it doesn't work?
Does PGP also has to be installed on the server?
Is is because of te version of PGP (I use 7.0.3)?
I hope someone can help me out.
Greeting Raphael
I'm new here, and I have just started working with PHP. I have this burning question:
I have a website with a form which uses a mailform.php
In this form you can fill in your stuff like name adress, ans also your creditcard number, cause you can buy stuff online.
I have used a PGP script inside my PHP, to encrypt the Creditcard number.
It's running on a Apache server. But we test it on a Xitama.
Locally PGP freeware 7.0.3 has been installed to generate a keyring.
But when the webmaster receives the email, the creditcard number is gone, empty.
This is the code:
_____________________________________________________________
function pgp_encrypt($keyring_location, $public_key_id, $plain_text) {
$key_id = EscapeShellArg($public_key_id);
putenv("PGPPATH=$keyring_location");
// encrypt the message
$pipe = popen("pgpe -r $key_id -af", "r");
fwrite($pipe, $plain_text);
$encrypted_text = '';
while($s = fgets($pipe, 1024)) {
// read from the pipe
$encrypted_text .= $s;
}
pclose($pipe);
return $encrypted_text;
}
$Nummer = pgp_encrypt("/location/pgpkey/", "webmaster@domain.nl", $creditcard);
_____________________________________________________________
Is it because of Xitama server, that it doesn't work?
Does PGP also has to be installed on the server?
Is is because of te version of PGP (I use 7.0.3)?
I hope someone can help me out.
Greeting Raphael