Blank encrypted messages

Matthew Reeve
Wed Apr 23 23:40:02 2003

Hi group,

I have just implemented gnupg to encrypt the contents of a webform and =
it. It took a while to get the PHP script to work, but it finally is. I
tried decrypting the block on my local machine (with the private key on) =
it comes up as an empty mail.=20

I have already checked that the string being executed contains the =
in the code below. Can anyone suggest what I can try to fix this?

The PHP code is as follows...

function _encrypt($msg)=20
$oldhome =3D getEnv("HOME");=20
$command =3D 'echo "$msg" | /usr/bin/gpg -e -a --always-trust  --batch
--no-secmem-warning -u -r';
exec($command, $encrypted, $errorcode);=20
if ($errorcode)=20
	die( "$errorCode");
} else {
	for ($index =3D 0; $index < ((count($encrypted))); $index++)
		$message .=3D $encrypted[$index];
	return ($message);

Many thanks in advance,

Matthew Reeve