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

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


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?

  • 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
  • @RobinWinslow try gvim – graywolf Nov 20 '15 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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