installation GPG on LINUX webFTP

manga4life at free.fr manga4life at free.fr
Sat Feb 21 15:46:48 CET 2004


Hello,

i have a question, i install gpg on windows xp, that s work fine.

i have a project, i want make a web appliaction who crypt text write in 
a form, and send it by email to my mailbox. Naturelly, the mail come 
crypt.
a friend create a script : for crypting the form
i submit the script for explain my project.
------------------------------------------------------------------------------------------
----------------------
<?php
  //create short variable names
  $from = $HTTP_POST_VARS['from'];
  $title = $HTTP_POST_VARS['title'];
  $body = $HTTP_POST_VARS['body'];

  $to_email = 'abc at abc.fr';

  // Tell gpg where to find the key ring
  // On this system, user nobody's home directory is /tmp/
  putenv('GNUPGHOME=/cgi/.gnupg');
  
  //create a unique file name 
  $infile = tempnam('', 'pgp');  
  $outfile = $infile.'.asc';

  //write the user's text to the file
  $fp = fopen($infile, 'w');
  fwrite($fp, $body);
  fclose($fp);

  //set up our command
  $command =  "cgi/gpg -a \\
               --recipient 'abc <abc at abc.fr>' \\
               --encrypt -o $outfile $infile";

  // execute our gpg command 
  system($command, $result);

  //delete the unencrypted temp file
  unlink($infile);

  if($result==0)
  {
    $fp = fopen($outfile, 'r');    
    if(!$fp||filesize ($outfile)==0)
    {
      $result = -1;
    }
    else
    {
      //read the encrypted file
      $contents = fread ($fp, filesize ($outfile));
      //delete the encrypted temp file 
      unlink($outfile);      

      mail($to_email, $title, $contents, "From: $from\n");
      echo '<h1>Message Sent</h1>
            <p>Your message was encrypted and sent.</p>
            <p>Thank you.</p>';
    }
  }

  if($result!=0) 
  {
    echo '<h1>Error:</h1>
          <p>Your message could not be encrypted, so has not been 
sent.</p>
          <p>Sorry.</p>';
  }
?>
------------------------------------------------------------------------------------------
----------------------

My problem is how install module GPG on the FTPi have an FTP 
account, accepting PHP, i know server is linux machine.
How can install GPG on a linux, i don't have linux to install files and 
upload them.

help me please
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20040221/42da2442/attachment.htm


More information about the Gnupg-users mailing list