Skip to main content
added 175 characters in body
Source Link
ilkkachu
  • 147.9k
  • 16
  • 268
  • 441

gpg -d just prints the file to standard output, but you can redirect the output to a file instead: gpg -d filename.txt.gpg > filename.txt. Or use the -o outputfilename option. Also, you can just run gpg filename.txt.gpg, which cause gpg to guess what you want, and in that case it decrypts the file to filename.txt (dropping the final .gpg).

Of course, note that when you decrypt the file on a regular filesystem, the OS may write it to the disk and removing the file afterwards will not clear remains of the file data from the disk. To avoid that, make sure to decrypt sensitive data only to RAM based filesystems.

On Linux, that would be the tmpfs filesystem. In some distributions, /tmp is a tmpfs by default. If it isn't, you can mount a new tmpfs simply with mkdir /ramfs; mount -t tmpfs tmpfs /ramfs (as root, change the ownership and permissions as required). Just mounting a filesystem doesn't mean that your files would be saved there, but a full discussion of safely handling sensitive data is outside the scope of this answer.

gpg -d just prints the file to standard output, but you can redirect the output to a file instead: gpg -d filename.txt.gpg > filename.txt. Or use the -o outputfilename option. Also, you can just run gpg filename.txt.gpg, which cause gpg to guess what you want, and in that case it decrypts the file to filename.txt (dropping the final .gpg).

Of course, note that when you decrypt the file on a regular filesystem, the OS may write it to the disk and removing the file afterwards will not clear remains of the file data from the disk. To avoid that, make sure to decrypt sensitive data only to RAM based filesystems.

On Linux, that would be the tmpfs filesystem. In some distributions, /tmp is a tmpfs by default. If it isn't you can mount a new tmpfs simply with mkdir /ramfs; mount -t tmpfs tmpfs /ramfs (as root, change the ownership and permissions as required).

gpg -d just prints the file to standard output, but you can redirect the output to a file instead: gpg -d filename.txt.gpg > filename.txt. Or use the -o outputfilename option. Also, you can just run gpg filename.txt.gpg, which cause gpg to guess what you want, and in that case it decrypts the file to filename.txt (dropping the final .gpg).

Of course, note that when you decrypt the file on a regular filesystem, the OS may write it to the disk and removing the file afterwards will not clear remains of the file data from the disk. To avoid that, make sure to decrypt sensitive data only to RAM based filesystems.

On Linux, that would be the tmpfs filesystem. In some distributions, /tmp is a tmpfs by default. If it isn't, you can mount a new tmpfs simply with mkdir /ramfs; mount -t tmpfs tmpfs /ramfs (as root, change the ownership and permissions as required). Just mounting a filesystem doesn't mean that your files would be saved there, but a full discussion of safely handling sensitive data is outside the scope of this answer.

added 538 characters in body
Source Link
ilkkachu
  • 147.9k
  • 16
  • 268
  • 441

gpg -d just prints the file to standard output, but you can redirect the output to a file instead: gpg -d filename.txt.gpg > filename.txt. Or use the -o outputfilename option. Also, you can just run gpg filename.txt.gpg, which cause gpg to guess what you want, and in that case it decrypts the file to filename.txt (dropping the final .gpg).

Of course, note that when you decrypt the file on a regular filesystem, the OS may write it to the disk and removing the file afterwards will not clear remains of the file data from the disk. To avoid that, make sure to decrypt sensitive data only to RAM based filesystems.

On Linux, that would be the tmpfs filesystem. In some distributions, /tmp is a tmpfs by default. If it isn't you can mount a new tmpfs simply with mkdir /ramfs; mount -t tmpfs tmpfs /ramfs (as root, change the ownership and permissions as required).

gpg -d just prints the file to standard output, but you can redirect the output to a file instead: gpg -d filename.txt.gpg > filename.txt. Or use the -o outputfilename option. Also, you can just run gpg filename.txt.gpg, which cause gpg to guess what you want, and in that case it decrypts the file to filename.txt (dropping the final .gpg).

gpg -d just prints the file to standard output, but you can redirect the output to a file instead: gpg -d filename.txt.gpg > filename.txt. Or use the -o outputfilename option. Also, you can just run gpg filename.txt.gpg, which cause gpg to guess what you want, and in that case it decrypts the file to filename.txt (dropping the final .gpg).

Of course, note that when you decrypt the file on a regular filesystem, the OS may write it to the disk and removing the file afterwards will not clear remains of the file data from the disk. To avoid that, make sure to decrypt sensitive data only to RAM based filesystems.

On Linux, that would be the tmpfs filesystem. In some distributions, /tmp is a tmpfs by default. If it isn't you can mount a new tmpfs simply with mkdir /ramfs; mount -t tmpfs tmpfs /ramfs (as root, change the ownership and permissions as required).

Source Link
ilkkachu
  • 147.9k
  • 16
  • 268
  • 441

gpg -d just prints the file to standard output, but you can redirect the output to a file instead: gpg -d filename.txt.gpg > filename.txt. Or use the -o outputfilename option. Also, you can just run gpg filename.txt.gpg, which cause gpg to guess what you want, and in that case it decrypts the file to filename.txt (dropping the final .gpg).