Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a small text file with personal (sensitve) information. I'm currently encrypting/decrypting it with the Makefile, as described on http://www.madboa.com/geek/gpg-quickstart/ ; relevant section is

edit:
    @umask 0077;\
      $(GPG) --output $(FILEPLAIN) --decrypt $(FILECRYPT)
    @emacs $(FILEPLAIN)
    @umask 0077;\
      $(GPG) --encrypt --recipient $(GPGID) $(FILEPLAIN)
    @$(RM) $(FILEPLAIN)

view:
    @umask 0077; $(GPG) --decrypt $(FILECRYPT) | less

this works fine for viewing, but not for editting: I first have to enter my password, then edit the file, but to encrypt it afterwards I again have to enter my password twice (and it's a long one).

Is there a better way to do this?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

I suggest using a mounted truecrypt volume instead.

truecrypt -M “rw,sync,utf8,uid=$UID,umask=0007″

This is the command to mount your truecrypt-container/volume giving you the right to read and to write data! After that follows the path to your truecrypt-container, for example /home/usr/tcvolume and then the place where you want the truecrypt-container to be mounted. In Linux this can be any ordinary folder, so for example, just create a folder “truecryptvolume”, no you type in the whole path (e.g. /home/usr/truecryptvolume ), so that the whole command looks like that:

truecrypt -M “rw,sync,utf8,uid=$UID,umask=0007 /home/usr/tcvolume /home/usr/truecryptvolume

(one line!)

Now you will be aksed for your user-or administratorpassword(sudo) and then for the volume password, if both are given correctly truecrypt will now mount your container.

By opening the folder “truecryptvolume” you will now be able to store your data encrypted.

Source of the above

share|improve this answer

I like the truecrypt suggestion above. But, if you must use GPG or can't use truecrypt, or if you have other strong passwords that you use, here are some suggestions:

The Yubikey is a USB device that can generate a long, static password with a button press. For extra security, type your own short string in the pw field before inserting the Yubikey's string.

You can store a long password in Passpack and copy it to the clipboard with a single click. Passpack will keep track of multiple strong passwords, and plays well with websites. Passpack even lets you use the Yubikey for two factor authentication.

Of course, you can use Passpack or the Yubikey to protect your truecrypt password.

If your sensitive info is really sensitive and you don't mind spending some $$s, use an encrypted USB drive like Ironkey. But Truecrypt on a flash drive gives you almost everything Ironkey provides apart from the self-destruct after too many wrong guesses feature.

share|improve this answer

'vim' + the 'gpg plugin' = lots of fun:

This script implements transparent editing of gpg encrypted files. 
The filename must have a ".gpg", ".pgp" or ".asc" suffix. When opening 
such a file the content is decrypted, when opening a new file the script 
will ask for the recipients of the encrypted file. The file content will 
be encrypted to all recipients before it is written.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.