Skip to content

Increased file size when sharing between encrypted devices #8556

Closed

Description

@Ratio2

v1.21.0, Linux (64-bit Intel/AMD)

Host1 normal: 2 bytes
Host1 normal -> host2 encrypted: 1435 byte
Host2 encrypted -> host3 encrypted: 1806 byte
Host3 encrypted -> host4 encrypted: 2177 byte

Seems just add 371 bytes of zero data

Data can be decrypted, but have some problems:

  1. Data not interchangeable between different encrypted hosts (seems file size stored in database)
  2. Data comparison problematic for check same state

All files for investigation: data.zip

Activity

  1. added
    bug
    needs-triage
    on Sep 26, 2022
  2. AudriusButkevicius commented on Sep 26, 2022

    @AudriusButkevicius
    Member

    Data is not supposed to be interchangeable nor comparable, and this is done on purpose, as it's encryption after all.
    Otherwise you potentially open up oracles and known cipher text attacks.

    i.e, if I know that I have an encrypted file that is top secret government document, and encryption was interchangeable and comparable, I could just find all other people that have the same encrypted file, and expose them.

    "Adds xyz zero data" - yes, encryption requires padding and adds non-trivial overheads.

    If you wish to discuss this further, please take this to the forum.

  3. Ratio2 commented on Sep 26, 2022

    @Ratio2
    ContributorAuthor

    Discussion on forum problem for me, just some notes:

    1. Encrypted data same, only zeroes added on another encrypted device (see screenshot)
    2. We can add padding on data transmission, no reason to keep zeroes on disk (we can trim zeroes and get same data)

    Screenshot from 2022-09-27 01-24-10

  4. imsodin commented on Sep 29, 2022

    @imsodin
    Member

    I don't think the OP was a complaint about added data/bytes when encrypting, but about unexpected behaviour of size when sharing with multiple encrypted devices. And the zeros look weird, data should be all random for encrypted files. Anyway it's not clear how the sharing exactly works. @Ratio2 Could you please explain with steps what you did to arrive to those file sizes, as suggest in a topic on https://forum.syncthing.net/ please.

  5. imsodin commented on Sep 30, 2022

    @imsodin
    Member

    With the additional information from the thread above, it's clear there is a bug:
    The problem lies in the trailer added on receive-encrypted folders containing the encrypted file-info (for offline decryption): On device 2, the size on the global file is 1064 as expected (minPaddedSize + blockOverhead). The local file is 1435 bytes, as the trailer size is added to the fileinfo. dev3 has those 1435 bytes as global, and adds its own trailer -> 1812 bytes.

  6. changed the title [-]Increase size of data when sync encrypted folder from one device to encrypted folder on other device[/-] [+]Increased file size when sharing between encrypted devices[/+] on Sep 30, 2022
  7. self-assigned this
    on Sep 30, 2022
  8. removed
    needs-triage
    on Sep 30, 2022
  9. added a commit that references this issue on Sep 30, 2022
    59c077b
  10. added 3 commits that reference this issue on Mar 10, 2023
    5019480
    703f20a
    122fdd7
  11. added this to the v1.23.3 milestone on Mar 14, 2023
  12. added a commit that references this issue on Mar 18, 2023
    7f99a25
  13. added a commit that references this issue on Apr 14, 2023
  14. added a commit that references this issue on Jan 28, 2024
    da72df6
  15. added
    frozen-due-to-age
    on Mar 9, 2024
  16. locked and limited conversation to collaborators on Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugfrozen-due-to-age

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions