3 ms·
> But by that way we lost dedup capability This depends on how secret do you want your data to be. You could use block-based encryption/compression and backup.
by viraptor 7y ago
> But by that way we lost dedup capability
This depends on how secret do you want your data to be. You could use block-based encryption/compression and backup. That way you can still dedup encrypted result.
If anyone can inject data into your system and monitor the backup, they could learn when they hit collisions, but for most personal backup cases that's irrelevant.
- kochthesecond 7y agoif you encrypt in a way that enables the service to do dedupe, you are either reusing IVs and encryption keys across items (bad) and leaking information that two items are the same item.
- viraptor 7y agoYou must not reuse IV between different blocks, but that does not stop you from using the same IV for the same block. Yes, you leak information about matching blocks - it's up to your use case whether you care about it.
- kochthesecond 7y agoYes, sorry I was imprecise. I meant reusing IVs for equal blocks only, to be able to see duplicate data.
- rzzzt 7y agoTurning two blocks of cleartext with the same content into equal blocks of cyphertext is not great for encryption: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_Codebook_(ECB) https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation...
- burmecia 7y agoI don't think the encrypt-then-dedup is a safe way to protect data privacy. In this case, identical blocks need to produce same cipher text, this will actually leak your data pattern even though it is encrypted. A better way I think is using randomly-seeded derived keys to encrypt each block, thus the identical blocks' cipher text will always be different.
- viraptor 7y agoYes, if that's more important to you than dedup savings, then you should definitely do that.
- kortex 7y agoDedup and encryption are 90° orthogonal. Encrypted data should look like uniform noise from every conceivable direction. Just the fact that blocks persist between encryption runs is leaking sigint. I think a better approach, if you want to have versionable files, but encrypted outside of the client, would be to do something with diffs, similar to Git, or perhaps staged dockerfile builds, depending on whether it is binary or text data.