GPG, Windows and USB

This is how I got gpg running on windows by retrieving the keys from an USB drive instead of the local hard disk.

Download the gpg binaries for windows and install them by a double click.

Change the PATH environment variable in order to have the command available in every position of the file system.

Right click on My Computer, Properties, Advanced, Environment variables, select the path from the System Variables and append the path to the gpg exe location (in my case C:\Program Files\GNU\GnuPG). Remember to separate it from the others with a “;” character.

Open a new shell and type gpg in order to see if the path was correctly taken, and exit with a CTRL+C, you should get something similar to

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\xxx>gpg
gpg: keyring `C:/Documents and Settings/xxx/Application Data/gnupg\secring.gpg' created
gpg: keyring `C:/Documents and Settings/xxx/Application Data/gnupg\pubring.gpg' created
gpg: Go ahead and type your message ...
gpg: processing message failed: eof

gpg is up and running. Now the problem is to have all keys on a usb device, so it will be possible to have sensible data cyphered without leaving the keys on the hard disk.

Open the registry editor (regedit.exe), navigate to HKEY_CURRENT_USER\Software\GNU\GNUPG and create a new String Value: HomeDir. Assign to it the path to the gpg directory on your usb drive in my case E:\davide\gnupg)

Now to verify to have the right path, type in a shell

C:\>gpg --list-keys

If you’ll get your keys in the list, it’s all right.

That’s all folks.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s