Skip to content

lib/protocol: Hide repeated data blocks in a given file - #7319

Merged
imsodin merged 1 commit into
syncthing:mainfrom
calmh:blockhashes
Feb 2, 2021
Merged

imsodin merged 1 commit into
syncthing:mainfrom
calmh:blockhashes

Conversation

@calmh

@calmh calmh commented Feb 1, 2021

Copy link
Copy Markdown
Member

Adds the block offset as additional data into the AES-SIV encryption of the block hash, thus making it not possible to correlate blocks at different offsets within a file. (These are never decrypted so there is no "other side" to this change.)

calmh added a commit to syncthing/docs that referenced this pull request Feb 1, 2021
@imsodin

imsodin commented Feb 1, 2021

Copy link
Copy Markdown
Member

(These are never decrypted so there is no "other side" to this change.)

Why actually? We could send and then decrypt the hash in requests from untrusted to trusted, thus being able to check the data. Maybe that doesn't happen to save a bit of overhead?

@calmh

calmh commented Feb 1, 2021

Copy link
Copy Markdown
Member Author

In theory we probably could, yes. Maybe we already do send it and just lack the verification, I'm not sure.

@calmh

calmh commented Feb 1, 2021

Copy link
Copy Markdown
Member Author

I think we do, let me add that.

Adds the block offset as additional data into the AES-SIV encryption of
the block hash, thus making it not possible to correlate blocks at
different offsets within a file.

Also, decrypts the block hash and passes it on to the next layer so that
it can verify the data as read.
@calmh

calmh commented Feb 1, 2021

Copy link
Copy Markdown
Member Author

There, now we actually decrypt the hash as well.

@imsodin imsodin left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the copierRoutine in the puller we already skip searching by weak hash for receive-encrypted folders. Now we can also skip searching by hash. We can't - we still want to reuse unchanged blocks.

@imsodin
imsodin merged commit 3b7a57d into syncthing:main Feb 2, 2021
@calmh
calmh deleted the blockhashes branch February 2, 2021 20:06
@calmh calmh added this to the v1.14.0 milestone Feb 4, 2021
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Feb 3, 2022
@syncthing syncthing locked and limited conversation to collaborators Feb 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants