As mentioned in this particular answer, compressing data before encryption may lead to the CRIME attack, especially if the hacker has collected many similar versions of the transmitted data.
Let's use the following example for this particular security case:
- Bob is using an encrypted personal diary program which is stored in a file which is encrypted using AES-256 in CBC mode with a SHA-256 HMAC (or AES-256 in GCM mode).
- The journal compresses entry text using LZ or DEFLATE compression upon saving them.
- The journal file structure is a fairly simple BSON tree (think JSON, but binary so no need to escape strings/etc.) which simply compresses the actual journal text upon file saving, but not the journal entry titles, dates, etc.
- Bob stores this file in a Dropbox folder which is synced across his machines.
- One of Bob's machines is compromised and Oscar now has access to his Dropbox account.
- Oscar can download all history for the journal from Dropbox.
What is the main attack surface, if any, for Oscar? Does having compressed data in the encrypted journal file offer compromises which Oscar can exploit?