Let's say I have one server that encrypts a file with a symmetric key, e.g. AES-CBC, and sends it to clients that decrypt it. Does that provide data integrity when decrypted? Or is it possible for someone to tamper with the file while it's still encrypted, and later when the client decrypts it, produce a modified file?
I typically see data integrity and authenticity discussed in terms of using digital signatures or MAC, but never in the context of encryption. I've also seen benchmarks that show encryption being more expensive than hashing, but that's not my main consideration.
I tried an experiment, where I used the openssl tool in Linux to encrypt a file. Then, I tried modifying the file in various ways (changing a byte, deleting a byte, appending a byte). In every case, when I tried decrypting, I would get a "bad decrypt" message. The commands I used were:
openssl enc -aes-128-cbc -in test -out test.enc
openssl enc -d -aes-128-cbc -in test.enc -out test.dec