3

I currently use a script to decrypt a file, but it writes it to disk. I then use wipe to clear it. Is there a way to write it to screen so it never writes it to disk?

I use the command $ echo PASSWORD | gpg file.txt.gpg and it creates a file.txt. Then I use wipe to erase the file. Can I extract it to my screen or tmp file system and use more/less to view it?

I know I can create a script to build a tmp file system, then decrypt to it, then view it under /tmp/ramdisk. I could just delete the tmp/ramdisk, but I was sure there was a program or a method to view it one time only to tmp ram system.

Limit
  • 3,191
  • 1
  • 16
  • 35
unixcreeper
  • 131
  • 1
  • 4

2 Answers2

2

By default, gpg -d does not write to disk. It just goes to stdout. You can then pipe that to your viewer of choice:

gpg -d file.txt.gpg | less

Or for vim, disable all of vim's temp file features. Then

gpg -d file.txt.gpg | vim -

wisbucky
  • 193
  • 5
1

All you need is the -d option to gpg:

gpg -d file.txt.gpg
DepressedDaniel
  • 1,240
  • 6
  • 8