Skip to content

Support for file encryption (e.g. non-trusted servers) #109

Closed

Description

@Natanji

So I have had a look at BitTorrent sync, syncthing and alternatives and what I always wondered about was the possibility to not only sync between resources I own and trust, but also external resources/servers which I do NOT trust with my data, up to a certain extent.

One way to do this is using ecryptfs or encfs, but this has many obvious downsides: it is not an interoperable solution (only works on Linux), the files are actually stored in encrypted form on the disk (even if the resource is trusted and this is not necessary, for instance because of the file system being encrypted already), etc.

What I propose is somehow configuring nodes which are only sent the files in an encrypted format, with all file contents (and potentially file/directory names as well; or even permissions) being encrypted. This way, if I want to store my private files on a fast server in a datacenter to access them from anywhere, I could do this with syncthing without essentially giving up ownership of those files. I could also prevent that particular sync node from being allowed/able to make any changes to the files without me noticing.

I realize that this requires a LOT of additional effort, but it would be a killer feature that seems to not be available in any other "private cloud" solution so far. What are your thoughts on this feature?

EDIT: BitTorrent sync mentions a feature like this in their API docs: "Encryption secret
API users can generate folder secrets with encrypted peer support. Encryption secrets are read-only. They make Sync data encrypted on the receiver’s side. Recipients can sync files, but they can’t see file content, and they can’t modify the files. Encryption secrets come in handy if you need to sync to an untrusted location." (from http://www.bittorrent.com/intl/de/sync/developers/api)

Activity

  1. jewel commented on Apr 4, 2014

    @jewel

    This would be amazing. I tried to spec out what this might look like in this clearskies extension, but it adds so much complexity that I've tabled plans for it for now.

    Like you say, if only the file contents are synchronized to the "untrusted" peers, that would be a lot simpler to implement (i.e. the metadata never hits the untrusted peer in any form). I hadn't thought of that.

  2. Natanji commented on Apr 4, 2014

    @Natanji
    Author

    It seems like you even thought of a zero-knowledge-proof to show that the server is legitimate/actually stores the files (did I understand that correctly?). Not bad.

    CTR mode sounds like an extremely bad choice for me, just like other stream ciphers like GCM. Yes, it is seekable and that is useful, but XORing two snapshots of encryption on top of each other will result in an adversary knowing what changed between the plaintext of those two files. CBC is a much better choice: when seeking, you may need two blocks of ciphertext to decrypt the first block of plaintext, but that is negligible usually because you will read more than one block anyway, and the more you decrypt the less overhead you get.

    I don't really understand why encrypting everything - including metadata - should somehow be "easier" or simpler to implement. Maybe I'm misunderstanding you? What do you mean?

  3. jewel commented on Apr 4, 2014

    @jewel

    I think you might have misunderstood, I was trying to say that it'd be simpler to implement if the metadata isn't synced.

    Thanks for the feedback on CTR mode, I wasn't aware that seeking was possible with CBC mode.

  4. calmh commented on Apr 5, 2014

    @calmh
    Member

    I could see how this would be useful. As you say, it would require some work because it's currently not a part of the design at all - an additional layer of encryption would be needed. There would obviously be some trade offs between privacy and efficiency, ie if a blocks changes in the middle of a large file, do we resynchronize just that block and leak that fact or re-encrypt the entire file etc.

  5. calmh commented on Apr 5, 2014

    @calmh
    Member

    Also slightly related to #62 which is similar functionality, minus the encryption (ie for when we trust the node with the data, just not with modifying it).

  6. NickPyz commented on Apr 7, 2014

    @NickPyz

    This idea is particularly useful for people who would use syncthing to setup a network of devices, and require 1 of them to be available 24 hours a day. Let's say all the devices are trusted except for the always on device, which is a 3rd party VPS server.

    In this case, it would desirable for some additional properties built into syncthing so that the VPS node has the following characteristics:

    READ ONLY (can't change any data)
    ENCRYPTED (so the VPS personnel can't see the data).

    No doubt this adds complexity and performance hits to support the encryption, especially if this project eventually extends to devices that don't support hardware-based encryption, such as most current smartphones,

  7. kylemanna commented on Apr 13, 2014

    @kylemanna

    Tahoe-LAFS has this feature and it would be awesome if a more usable implementation (I find tahoe-lafs WebAPI very painful and difficult to use).

    https://tahoe-lafs.org/trac/tahoe-lafs/browser/trunk/docs/architecture.rst#security

    It has the notion of "storage nodes" that hold chunks of distributed encrypted data. The default configuration is that any 3 chunks can restore the file out of a goal of 10 chunks on different storage nodes using erasure coding.

    It would be nice if syncthing could support the distributed fractional concept as well, but that sounds like a topic for another issue. It may be out of scope too, hopefully not :)

  8. Natanji commented on Apr 16, 2014

    @Natanji
    Author

    Tahoe-LAFS sounds pretty much exactly like what we want - what and incredible find, I hadn't heard of it. Thanks, @kylemanna :)

    The way I see it, syncthing already has the functionality to keep directories in sync and perform upload/download operations between the nodes whenever something changes. So the feature we want might not be that far out of reach: whenever a file changes, then we have to call the API of tahoe-lafs and upload/download the file.

    I agree that we should start with a configuration where files are simply replicated completely on all foreign nodes. Fractional distribution can be added later if this setup turns out to work well.

    The solution would also work on both Windows and Linux, which is a huge plus! And we don't have to do any crypto storage of our own, which would most probably turn out to be a failure anyway, I presume. :)

    Sooo... anyone see a problem with this approach yet, from a design perspective? @calmh, do you think syncthing's design is compatible with tahoe-lafs?

  9. calmh commented on Apr 16, 2014

    @calmh
    Member

    Sure. However if Tahoe-lafs is a "cloud storage system", then perhaps that is all you need and syncthing doesn't add much to the equation if you already have that up and running?

  10. kylemanna commented on Apr 16, 2014

    @kylemanna

    I played with Tahoe-lafs for a while and it doesn't really do what I want. The major deal breaker for me was that the storage nodes don't work behind NAT. Everything I could find suggested that I needed to do port forwarding and tunneling of some sort. I'd imagine that a significant portion of the user base for syncthing is behind a NAT.

  11. mcg commented on May 12, 2014

    @mcg

    These days, without some form of encrypted/untrusted node support, Syncthing is probably going to be unusable for some portion of users. One of the reasons I choose BT Sync over other solutions was it's support for this.

  12. elimisteve commented on May 17, 2014

    @elimisteve

    This feature would be great because it'd allow me to replace the rather bulky and Mono dependency-laden SparkleShare with syncthing, which is much easier to set up :-).

    SparkleShare has been working well for me, though.

  13. EvdH0 commented on May 18, 2014

    @EvdH0

    This would indeed be a great feature!

  14. menelic commented on May 19, 2014

    @menelic

    This would indeed be a great feature, especially if it could be defined on a folder and/or file level as in BTSync. I'd argue adding this feature is part of the "BTSync-replacement" goal. This would add complexity for sure, but it would be great to have one Syncthing interface from which I can manage my synchronised shares with people who are supposed to have access as well as with locations which are not supposed to either have access or be able to see the files. As a VPS user, this would be great for me - and surely for a lot of others as well.

  15. 129 remaining items

  16. lkwg82 commented on Feb 4, 2018

    @lkwg82
    Contributor

    see PR #4331

  17. removed this from the milestone on Feb 11, 2018
  18. unlocked this conversation on Oct 1, 2020
  19. Max-Schmeling commented on Dec 27, 2020

    @Max-Schmeling

    Is end-to-end-encryption still being considered by the devs? I found librevault, but it has not been updated since 2016.

  20. nunesgh commented on Dec 27, 2020

    @nunesgh
  21. onlyjob commented on Dec 28, 2020

    @onlyjob

    For untrusted backups you probably want Duplicati, Borg or Rclone.

    Or restic.

  22. imsodin commented on Dec 28, 2020

    @imsodin
    Member

    Please only comment if you have something to write that is pertinent to the issue at hand. That Syncthing isn't a backup solution on its own and what actual backup programs exist is not relevant here.

    As @nunesgh wrote, a solution for untrusted/encrypted devices is being tested and improved at the moment. A wider call for testing will likely happen in on of the next releases (and will also be announced in this issue). Please do not ask questions about the feature here or start any related discussions - join https://forum.syncthing.net/ for that.

  23. Absolucy commented on Dec 28, 2020

    @Absolucy

    That Syncthing isn't a backup solution on its own and what actual backup programs exist is not relevant here

    It is useful information for anyone who searches "syncthing encryption" and finds this issue.

  24. locked and limited conversation to collaborators on Dec 28, 2020
  25. imsodin commented on Apr 6, 2021

    @imsodin
    Member

    This feature is currently being tested. You can try it out and help ensure it is ready to be used on our precious data. Check this forum thread for infos on how to try it out: https://forum.syncthing.net/t/testing-untrusted-encrypted-devices/16470

  26. added 2 commits that reference this issue on Apr 12, 2021
    0a3a862
    847b0ab
  27. added this to the v1.16.0 milestone on Apr 13, 2021
  28. added a commit that references this issue on May 8, 2021
    7c377a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions