Using gpg to encrypt files on a web server

I was working on my website, and I wanted a way to protect files that are uploaded by the users. My solution is to encrypt the files with gpg when they are uploaded. Only the public key is stored on the server and the files are encrypted with this. The only way for the files to be decrypted is for them to be downloaded and then decrypted with my private key.

The steps needed in order to achieve this are:

  1. Obtain gpg and generate a public/private key if you don’t already have one (gpg –gen-key)
  2. Export your public key to a file (gpg -a –export > pubkey.txt)
  3. Upload the pubkey.txt file to your server
  4. Create a directory accessible to the webserver (apache) process
  5. Create a public keyring in this directory (gpg –no-default-keyring –keyring /path/to/pubring.gpg –import pubkey.txt)
  6. Make sure that this file is readable by your webserver process
  7. You may now encrypt files using the command line “gpg -q –batch –no-options –no-default-keyring –keyring /path/to/pubring.gpg -r brett –always-trust –output encrypted.enc –encrypt unencrypted.txt”.

Make sure you back up your private keyring – if you lose it, your files will NEVER be decrypted!

Mobile Reading

I’ve been interested in electronic book readers with e-Ink technology ever since I read about the Sony Reader. I waited and waited for them to bring the reader out in the UK, but it’s been over a year and still no release.

A friend sent me a link the other day about the Iliad. This seems like a fantastic device, but it’s quite expensive!

I then discovered a review on e-book readers on Wired magazine. This led me to discover Bookeen’s CyBook Gen3. The CyBook is lighter and cheaper than the Iliad and the battery lasts a lot longer. According to two reviews I read; the screen quality isn’t quite as good on the CyBook as compared to the Iliad, and both reviews mentioned that the button for turning the pages was awkwardly placed. There seems to be a very active developer community for the Iliad which is a big plus.

The price, weight and power consumption difference between the Iliad and the CyBook are probably because the Iliad has a Wacom digitizer in it, so you can draw and take notes on the screen. Also the Iliad screen is bigger and supports 16 shades of gray as opposed to 4.

Fire on Oxford Street!

I heard the sound of sirens, so went to our balcony to see what was happening. There were fire trucks and police and a bank of red buses queued up. It all seemed to be centered a couple of blocks from our apartment. Helen and I walked down the street and I snapped a couple of pictures.

Fire on Oxford Street Fire from our balcony

The Redshift Techno-Economic Theory

The Redshift theory basically categorizes computing needs as either growing faster or slower than Moore’s Law. Traditional business is over-served by Moore’s Law, whereas applications such as financial market simulations, drug industry research, computer animation, and the high-growth end of the internet industry (Facebook, You-Tube, Flickr), are needing computing resources faster than Moore’s Law. These industries are apparently the ones going to generate above-GDP levels of return to an investor.

This theory was advanced by Greg Papadopoulos of Sun Microsystems. One of Sun’s solutions for servicing the computing needs of “Redshifting” companies is Project Blackbox – providing as much computing power as possible inside a shipping container.


OK, so I hear Facebook is where all the cool middle-aged people are hanging these days. I just joined, and I have a total of 1 friend in London! Count ’em people!

I did check out an Atheist group, and found a link to a funny stand-up rant by George Carlin:

Birthday Post!

Another day older today. Helen made me breakfast – sausages, bacon, mushrooms – which we ate on the balcony overlooking Oxford Street. I have been having a completely self-indugent day, watching DVDs and playing on my notebook. Almost too lazy to post a blog entry! I figure I’ll type something up to mark the day.

Tim and Anna and kids should be arriving from Tokyo, so the evening may be structured around bottles of champagne in their hotel room. Just a guess.

In Yorkshire

Helen has taken me to Yorkshire for an early birthday weekend. We are staying at a place called “The Devonshire Arms” near Bolton Abbey – a beautiful ruined abbey. The hotel is great! There are two heli-pads, and throughout the day choppers buzz down like giant metal gnats to drop off a fresh batch of gourmets for the restaurant. We wanted to get out of London to soak up some nature. I guess you can still call thousands of years of farmed land “nature”, can’t you?

We went for a long walk – over 20 kilometers over moors and farms, and I am now sunburnt as hell. The skeletal remains of ancient ruined buildings were languidly picked over by the weekend hikers as we ambled the day away.

Meditation on chopsticks…

Chopsticks are great – until you get to that last bit of food at the bottom of the bowl that is. Then you’re left trying to turn a pair of round sticks into a spoon. They’re not so good with soup, or steaks. Maybe the satisfaction of eating with chopsticks is simply the extra effort needed to get food to mouth without detouring to table.