cryptee / web-client

Cryptee's web client source code for all platforms.
https://crypt.ee
Other
444 stars 22 forks source link

[Feature request] Download entire folder #145

Closed elendil7 closed 2 years ago

elendil7 commented 2 years ago

Hello,

I recently migrated to crypt.ee, and am loving the encryption & cross-platform capabilities. Very promising app so far. However, I would like to suggest a feature similar to that of the bulk document download - except for folders.

Since I only do journalling (taking up little storage space), this feature would be extremely beneficial for both myself and others who adhere to similar practices.

An example of this implementation would be as follows:

Thanks in advance for your time, Kind regards.

johnozbay commented 2 years ago

Hi there! đŸ‘‹đŸ» Thanks a lot for reaching out with this!

Up until autumn 2020, we used to have this feature. However we realized for some pro-users, this feature is quite dangerous, could cause a lot of problems if not used carefully, and it comes with a great level of technical difficulty.

For example, what should happen if you're on a 400GB and 2TB account, your laptop has 50gb free storage space, and you press "download folder" which has tons of sub-folders and a total of 100gb of files? This could theoretically suck all the free storage on your laptop to a point of making it un-usable. And you might rightfully be thinking: "but it's everyone's own problem, and people should know better not to make this mistake" or “but the browser wouldn’t let that happen now
 would it?”– it's sadly a bit more complicated than that.

Because your documents, files, photos etc are all encrypted on your device, and we don’t have your key to decrypt them; we’re mathematically unable to package your files in a nice and tidy way for you to download in a single clean zip file, like unencrypted services/apps can do.

To understand why this is the case, it’s important to think about, in abstract terms, what a ‘download’ is. You point your browser to a url, like : page.com/file.zip and your browser downloads file.zip.

With Cryptee, since your files are individually encrypted on your device, our servers don’t have the unencrypted files, and they don’t even know file names or file formats, there isn’t a url we can point your browser to. To our servers, every file looks like file-12345.crypteefile etc.

Therefore, our servers can’t even package these together in a zip, and let you download. Because in order to save/download the decrypted files to your device’s storage, you first have to download and decrypt them one-by-one, on your device.

And we can’t do this on our servers, because your key never leaves your device, meaning that we are mathematically unable to offer zipped downloads.

So here comes the issue. Because of all this (the fact that Cryptee doesn't use a standard 'point browser to url to download' mechanism, and because all the files are decrypted & 'generated' in your device's memory for downloading), browsers cannot warn users before they run out of storage, since it's not following the traditional download routine, browsers have no way of knowing how much storage the download will take, so they don't (and can't) know when to stop 'downloading', and thus can potentially render your devices un-usable.

Normally, a browser looks at the download and thinks “this file is 50gb once downloaded, but there’s only 8gb available, abort download” – in case of cryptee, this value (50gb) is only known to the browser after the fact that the download is complete. Hence the complication.

Until autumn 2020, we thought, this should be safe for at least the 10gb accounts, so we had this feature. What happened is, some users tried downloading ±8gb folders to their phones / tables, which apparently had less than 8gb storage available, and caused major headaches.

In addition – for safety/privacy browsers don’t expose or report how much storage is used/available on your device to websites accurately (or not at all), so that sites can’t fingerprint you etc on the internet using these values, making it impossible for us to check the available storage either.

So consequently, we decided to remove this feature for safety. If there ever comes a day where we can solve this problem with some technical workarounds, we’ll certainly add it back. But until then –as much as I personally dislike it too– what we have currently is the safest option.

Hoping this makes sense and helps! âœŒđŸ» All the very best, J

elendil7 commented 2 years ago

Thank you for taking the time to respond.