say this:

openssl enc -aes-256-cbc -e -in test.txt -out test-enc.txt


rm test.txt

Then, I'd like do decrypt text-enc.txt without saving the output, just see it on a text editor (say sublime text) and then close and forget. So on my disc there's only test-enc.txt. Is it possible?

If possible, I'd like to save some aliases on my bashrc to open, modify and encrypt it again.

  • You might want to consider a purpose-built program for saving encrypted text (like a password manager, KeePass, etc) that won't scatter temporary files around your hard drive, and other (editing) programs that use your decrypted file might write more temporary files too, it's trivial to undelete a file that's only been rm'd, and if your swap isn't encrypted it could be another leak. And openssl's enc command might not be particularly secure on it's own
    – Xen2050
    Sep 3 '18 at 6:49

You can use /dev/shm, which is usually populated with a tmpfs which resides in memory only. Another way would be to use pipes for transferring the data from openssl ... -out /dev/stdout to the desired program using pipes and stdin.


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.