I’ve recently read through all of Security Architecture — Cryptomator 1.6.0 documentation and had some lingering questions about why certain choices were made that are not explained. I am not sure if it is just common sense stuff when it comes to encrypting files, if it is maybe some links to external resources could be useful as well if this is the first place someone (like me) is learning and digging into the details of this sort of thing.
Primarily I am wondering if there is a full explanation of why the file content encryption is done the way it is:
- Why is is done in chunks rather than over an entire file?
- What was the determining factor of said chunk size?
- Maybe some more info on the purpose of HMAC’s and how they are used.
I also wanted to know more about the inverse of everything in the architecture section. It covers in depth how things are encrypted, but it does not cover reading the files back out and what guarantees cryptomator does to ensure files are durable. I assume the hmac’s on each chunk are to ensure content of any chunk is not edited, but this requires the software decrypting the files to verify these. It would be great to see pseudo code examples of how cryptomator reads the files back. Some simple versions of this process like what is there currently for the encryption process would go a long way in understanding imo.
I assume many of these choices were made to make it possible to read a file partially in order to stream files and get partial bits of a file, but this is just a guess after reading and understanding more of the cryptomator offering. The docs could have a section on the mobile implementations too explaining how those work (I assume they are not downloading the entire vault to the mobile device, but rather get them as needed.