title: GnuPG - How to edit the file without decrypt and save to local disk first?
body: <p>I'm using GNUPG to encrypt my ascii files.</p>
  
  <p>I learnt to generate a key, also how to use the it to encrypt and decrypt a file.</p>
  
  <p>There are two ways I used:</p>
  
  <pre><code>gpg -d foo.txt.gpg
  </code></pre>
  
  <p>and</p>
  
  <pre><code>gpg --output foo.txt --decrypt
  foo.txt.gpg
  </code></pre>
  
  <p>I realized the first method will display the decrypted file on the screen, for example when I executed the command over SSH.</p>
  
  <p>With regard to the second method, I concerned if it will leave a trace on the local pc - the 
  foo.txt file.</p>
  
  <p>Most importantly, I don't know how to edit the contents of the foo file on the fly.
  Ideally, I would like to open the file over SSH use nano/pico, type my passphrase to decrypt, then edit the file, save it and encrypt it. I very much like to avoid save any files to the local disk.</p>
  
  <p>Any comments are welcome.</p>
  
  <p>Thank you in advance.</p>