title: Can I decrypt an encrypted file even if someone modified it?
body: <p><em>Warning: This question has been heavily edited. I tried my best to guess the original author's intentions. Please view the <a href="https://stackoverflow.com/revisions/d1be2de5-242d-4935-b9ff-486641da6681/view-source">original version</a>.</em></p>
  
  <hr>
  
  <p>I'm unsure on how to use the GPG command line tool, that we're using to encrypt files.</p>
  
  <p>File.txt is a simple text file:</p>
  
  <pre>
  Testing
  hello world  
  My security things.
  </pre>
  
  <p>This is how I encrypt the file:</p>
  
  <pre><code>gpg --symmetric File.txt 
  </code></pre>
  
  <p>This gives me a new, encrypted file: File.txt.gpg</p>
  
  <p>If someone else now modifies the encrypted file, I'm no longer able to decrypt it.</p>
  
  <pre><code>$ gpg --decrypt File.txt.gpg 
  gpg: no valid OpenPGP data found.
  gpg: decrypt_message failed: eof
  </code></pre>
  
  <p>How can I get the content of my file, even though someone has modified it?</p>