* Home
* FrontPage Hosting
* mySQL Hosting
* Dedicated Servers
* Managed Services
* Domain Parking

Direct Email Marketing with Constant Contact

Search our FrontPage Support Area
FrontPage Support Area Site Map


How to use PGP to send encrypted email

  1. Purchase the appropriate server version of PGP.
  2. FTP the "pgp" file in binary mode to your cgi directory.
  3. Change the permission of "pgp" to 755.
  4. Create a symbolic link from "pgp" to "pgpe" in the same directory.
  5. Have the merchant create their private and public PGP key (they will need to have their own, local, license of PGP; some programs like Eudora Pro come with this license and GUI-based tools to make using PGP locally easy).
  6. FTP (publish) the merchant's pubring.pkr file in binary mode to the cgi directory.
  7. Create an ASCII (notepad will do) "pgp.cfg" file containing the line below, and FTP this file to the server in ASCII mode to the cgi directory:

Pubring="FULL PATH TO CGI DIRECTORY/pubring.pkr"

Example:

Pubring="/u/web/someid/cgi-local/pubring.pkr"

  1. Develop a CGI/ASP script using the following logic:

#!/usr/bin/perl
# Tests the operation of PGP 5.0 from a Perl script
$| = 1;
print "Content-type: text/plain\n\n";

# This should be changed to your PGP path and desired recipient
# recipient tells pgp which key to use for the encryption
# Lose the 2>&1 if you don't want to see the PGP messages
$pgpcmd = 'u/web/username/pgp_dir/pgpe -r recipient@domain.com -aft 2>&1';

# We need a library function
use IPC::Open2;

# Open the PGP program for bi-directional I/O
$pid = open2(\*READPGP, \*WRITEPGP, $pgpcmd);

# Send text to be encrypted to PGP
print WRITEPGP "This is a test of PGP 5.0 in a Perl script\n\n";
print WRITEPGP "This is a test of PGP 5.0 in a Perl script\n\n";
print WRITEPGP "This is a test of PGP 5.0 in a Perl script\n\n";
print WRITEPGP "This is a test of PGP 5.0 in a Perl script\n\n";
print WRITEPGP "This is a test of PGP 5.0 in a Perl script\n\n";
print WRITEPGP "This is a test of PGP 5.0 in a Perl script\n\n";

# Encrypt the data
close(WRITEPGP);

# Get the encrypted data from PGP
@pgptext = <READPGP>;
close(READPGP);

# Return information to user
print @pgptext;

Peter Abraham


Direct Email Marketing with Constant Contact


Dynamic Net, Inc.

Legal Notices; Copyright © 1996 - 2006 Dynamic Net™, Inc. All rights reserved.
See our privacy statement for questions on how we use information gained by our site.
Managed Services provided by We Manage Servers; hosted by Dynamic Net, Inc.
Last updated: Thursday November 16, 2006 18:22 -0500