-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encrypt then Compress? #2
Comments
The docs have been updated, and based on the code https://github.com/xordataexchange/crypt/blob/master/encoding/secconf/secconf.go#L43 we should be doing compression first, then gpg, and then base64. If that is not the case we need to fix it ASAP. |
Ah, ok thanks! |
OK to close? |
Yep, sorry I was on mobile and there wasn't a link to close. :) |
You probably ought to not be compressing it. It's not specifically bad in this case, but compress then encrypt is known to cause problems in a lot of scenarios. Avoiding it overall is a good habit to have |
Yeah, this might be worth opening another issue for. |
If you provide some research material, we can consider removing the compression. for config files, it's not much of a gain/loss anyway, but I'd like to see something concrete. |
The primary examples are those already mentioned in the comments: CRIME and BREACH |
From the documentation page, it states "After encryption, it is gzip'd, and base64 encoded so it can be stored in your key/value store of choice." I am wondering what the intuition is behind this?
Compression is only useful for non-random (especially text) data and whereas encryption attempts to output seemingly random data (across a uniform distribution). Clearly crypt shouldn't do the alternative of compress then encrypt as that opens up to other attacks such as seen with CRIME. So why encrypt then compress?
The text was updated successfully, but these errors were encountered: