Other than work or school, what do you use your computer for most regularly? I’ve listed some common activities below, but feel free to mention something that’s not on the list… and please keep it clean.

  • Play music
  • Watch movies or video, including YouTube
  • Play games
  • Look up stuff on the Web, including answers to questions or solutions to problems
  • Email
  • Socialize – Facebook, Twitter, blogging, etc.
  • Date
  • Share photos
  • Shop, including looking at product reviews
  • Sell stuff
  • Get directions
  • Get news, including sports, movie reviews, etc.
  • Manage finances, including online banking & tax prep
  • Find a job

{ 0 comments }

Bluehost has a great tool for creating custom online forms called phpFormGenerator. You can set up the form to email data to you. Getting that form to email you the data in a secure, encrypted format, however, is quite a challenge.

In this post, I show you how to configure a form to encrypt the form data, have the encrypted message sent to you via email, and then decrypt the form in Microsoft Windows Outlook Express.

I’m assuming you already created a form using phpFormGenerator and have it set up to email you the form data.

Shameless disclaimer: This works for me, and I think it’ll work for most Bluehost users running Windows and using Outlook Express. I’m not sure how helpful it will be for others. If anyone knows an easier way, please share.

Create Your GnuPG Keys

If you haven’t created your GnuPG encryption keys yet, do so – on the Bluehost Control Panel in the Security box, click GnuPG Keys and then follow the instructions. You’ll need the email address you used to generate the keys for the next step.

Edit process.php

phpFormGenerator creates a file called process.php, which processes the form data and emails it to you. Open process.php, and delete the following line:

mail("yourmail@whatever.com","Form Submitted at your website",$message,"From: phpFormGenerator");

In its place, insert the following code… right before the closing php code ?>. And make a few adjustments as indicated in the code’s contents. (I got most of this from an article called “How to send encrypted messages using PGP and PHP scripts” but had to make changes to get it to work with my form.):

//replace yourmail@whatever.com with the email address you used to generate the GnuPG keys
$pgpuser = "yourmail@whatever.com" ;

//replace yourmail@whatever.com with the email address to which you want the form data sent
$testemail = "yourmail@whatever.com";
$emailsubject = "Encrypted Information";
$emailfrom = "From:". $_POST[email];
$body = $_POST[message];

//Indicate the location of your .gnupg folder. When you login to the Bluehost Control Panel, the left column shows your "Home Directory." Replace /home/username with your home directory, keeping the .gnupg at the end
putenv("GNUPGHOME=/home/username/.gnupg");
$infile = tempnam("/tmp", "PGP.asc");
$outfile = $infile.".asc";
$fp = fopen($infile, "w");
fwrite($fp, $message);
fclose($fp);
$command = "gpg -a --always-trust --batch --no-secmem-warning -e -r $pgpuser -o $outfile $infile";
system($command, $result);
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 file
unlink($outfile);
//send the email
mail ($testemail, $emailsubject, $contents, $emailfrom);
print "Thank you!! Your encrypted e-mail has been sent. ";
}
}
if($result!=0) {
print "Their was a problem processing the information.";
}

Make sure you have the closing php code at the end: ?>

At this point, you should be able to pull up the form, complete it, click the Submit button, and receive the data (encrypted) via email. Now, you need to decrypt it.

Install GnuPG on Your Computer

I’m assuming you never installed GnuPG on your computer. If you have or are not sure, follow the “Step-by-step GnuPG Installation and Configuration on Windows.”

If you’re sure you don’t have old GnuPG files on your computer, head to the GnuPG Download page, scroll down to the Binaries section, and click the link to get the Microsoft Windows version. Run the file you downloaded to install GnuPG on your computer. Don’t change any of the default installation settings.

Now, copy your key files from Bluehost to the GnuPG folder. This is easier said than done, because, by default, Bluehost hides the .gnupg folder where your keys are stored. Here’s what you do:

  1. Go to the Bluehost Control Panel.
  2. Under Advanced, click Index Manager.
  3. Click the option to show hidden files.
  4. Go back to the Control Panel and launch the File Manager.
  5. Click the Home directory above the file list.
  6. Click .gnupg. (If you still don’t see the .gnupg directory, try searching for gnupg using the Search box in the upper right corner of File Manager.)
  7. Download the files pubring.gpg, secring.pgp, random seed, and trustdb.gpg into the folder C:\Documents and Settings\<UserProfile>\Application Data\GnuPG.

Tip: After downloading your encryption keys, consider deleting your private key – secring.pgp – from the Bluehost server for extra security. GnuPG will create a new secring.pgp on the server later when form data is submitted, but the file will be empty.

Configure GnuPG to Run from Anywhere

To avoid problems, configure GnuPG to run from any directory on your computer. In Windows XP, here’s what you’d do:

  1. Right-click My Computer and click Properties.
  2. Click the Advanced tab.
  3. Click Environmental Variables.
  4. Under System Variables, click Path and then Edit.
  5. At the end of the path statement, type ;C:\Program Files\GNU\GnuPG
  6. Keep clicking OK to close the dialog boxes and save your changes.

Test the Installation

To make sure GnuPG is installed correctly…

  1. Click Start, Run.
  2. Type cmd and press Enter.
  3. Type gdp --version and press Enter. You should see a bunch of information about GnuPG.
  4. Type gdp --list-keys and press Enter. You should see information about your pubring.gpg.

Install GnuPG for Outlook Express

Now, you’re ready to install GnuPG for Outlook Express. Head to the Wald GPGoe Project page, click the gpgoe download link and follow the link trail to the latest version.

Download and save the file to your computer, unzip it, and then run the file named GPGOEInit.exe. You should see a little keyhole icon in your system tray indicating the program is running.

Try It!

At this point, all the pieces are in place. Head to your website, pull up the form, enter some data, and click the Submit button. Then, run Outlook Express, check for mail, and you should receive an encrypted email message. When you open it, you should see the encrypted message along with a dialog box asking for your pass phrase. Type the pass phrase you used when creating your GnuPG keys, press Enter, and you should see the form data you entered.

{ 0 comments }

Getting Published: What You Know and Who You Know

February 19, 2010

Twenty years ago, all you had to do to be a successful author was write a good book on a topic of interest to consumers. The publisher would get it into the bookstores, people would buy it, and all you had to do was run to the bank to deposit your royalty checks. (You had [...]

Read the full article →

Super High Electric Bill

February 5, 2010

$639! That’s up $100 from last month and more than double any bill from last winter.
I know it’s been a cold winter, but… what the …?!
We’ve had problems with the furnace, a geothermal unit that’s supposed to be energy efficient, but… what the …?!
We had even sealed off the upper floor where our bedroom is [...]

Read the full article →

How Much Electricity Does My Refrigerator Use?

January 21, 2010

To trim our electric bill, I considered taking our second refrigerator out of service. I was curious as to how much that would save us per month, so I plugged my handy Kill A Watt EZ Electricity Usage Monitor and plugged the refrigerator into the monitor to find out.
(The refrigerator is a 21 cubic foot, [...]

Read the full article →

How Much Electricity Does My Computer Use?

January 19, 2010

My last electric bill was a whopping $566 – just what I needed to motivate me into thinking about energy conservation. (My bills generally run around $250 in the winter. I suspect that most of the increase had to do with the fact that our geothermal furnace wasn’t working properly during the deep freeze of [...]

Read the full article →

Tips for Promoting Your Book, Yourself, or Just About Anything Online

January 6, 2010

I team up with experts to write about topics I know little or nothing about, so the marketing I do to promote the books usually has little impact. Unlike my coauthors, I lack the credentials and expertise to speak with a voice of authority on most topics we cover, and except for my mom, nobody’s going [...]

Read the full article →

The Team Writing Advantage

December 17, 2009

I have been teaming up with experts in different fields for about five years now to produce books on a variety of topics, including bipolar disorder, food allergies, slam poetry, and real estate investing. I even co-authored a book on oceanography.
I could probably write books on these topics myself, but they wouldn’t be nearly as [...]

Read the full article →

Flipping Houses Back in Vogue?

December 11, 2009

About six months after the publication of my book Flipping Houses For Dummies, the housing bubble burst, the mortgage market melted down, and sales of the book tanked. Rotten timing.
So you can imagine my delight upon discovering a story this morning that appeared in the Wall Street Journal a couple days ago entitled “House Flipping [...]

Read the full article →

Global Warming Skepticism Grows

December 6, 2009

When I first started expressing my skepticism of global warming, the general consensus was that the world was getting significantly warmer and human beings were the primary cause. As a result of a few email messages implicating global warming “scientists” in a plot to fudge the data, the pendulum has suddenly swung the other way. [...]

Read the full article →