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.

Okay this is a weird sort of question. I might get down-voted for being stupid here.

I'd like to be able to edit an encrypted file, but without having to manually decrypt it to a location on the disk.

I see the workflow going something like this:

  • I type a unix command, naming the encrypted file to edit
  • I enter the password to decrypt the file stream
  • A graphical editor opens containing the decrypted version of the file
  • I can edit the file, and whenever I save it gets encrypted on the fly back into the encrypted file
  • When I close the editor, only the encrypted file remains

I kinda thought it should be possible to get an editor to talk to an on-the-fly encryption stream but think it was talking to a normal file. Something like:

$ sublime-text | open-gpg-stream my-encrypted-file.gpg
password: 

Is this possible? Or is my understanding just way off? If this isn't possible, could you please explain why it's not possible?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

It’s not a weird question, but you might do better simply looking for an editor that already, natively, does what you want.  For example, vi and vim do.  Just don’t post a question to Super User asking, “Where can I buy …?”

Failing that, can you wrap your favorite graphical (but encryption-unaware) editor in a script that handles the encryption part?  I understand that you don’t want to write the file to disk in the clear –– but can you decrypt the file and write it to a tmpfs file system (RAM disk) or an encrypted file system?

share|improve this answer
    
Ah! vim is the perfect solution. I just do vim -x myfile.txt and it works exactly as I want. I have version 7.3 according to this article it should be using the fairly decent blowfish cypher. I'd still like to know if there is an easy way to achieve this for a graphical editor, but vim is a perfectly good solution. Thanks. –  Robin Winslow Jun 16 '13 at 17:35

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.