Can I decrypt an encrypted file even if someone modified it?

Posted by kiruthika on Stack Overflow See other posts from Stack Overflow or by kiruthika
Published on 2010-04-15T08:41:28Z Indexed on 2010/04/15 13:03 UTC
Read the original article Hit count: 391

Filed under:
|

Warning: This question has been heavily edited. I tried my best to guess the original author's intentions. Please view the original version.


I'm unsure on how to use the GPG command line tool, that we're using to encrypt files.

File.txt is a simple text file:

Testing
hello world  
My security things.

This is how I encrypt the file:

gpg --symmetric File.txt 

This gives me a new, encrypted file: File.txt.gpg

If someone else now modifies the encrypted file, I'm no longer able to decrypt it.

$ gpg --decrypt File.txt.gpg 
gpg: no valid OpenPGP data found.
gpg: decrypt_message failed: eof

How can I get the content of my file, even though someone has modified it?

© Stack Overflow or respective owner

Related posts about gpg

Related posts about decryption