Whenever I try to find the size of a file in linux I usually go du -s file. However the result for decrypted files size is 0. Therefore I usually open a file explorer (Nautilus for example) and find there what is the file size. I don’t know how Nautilus can find it out while my du is not working.
After spending quite a while online and reading manuals, I couldn’t find an explanation of how file decryption works in storage basis. Hence I would appreciate if you could clarify the following questions:
Why Cryptomator doesn’t require extra file space for the decrypted files? For example, I couldn’t find any cache directories (for desktop version without referencing to cloud storage).
Decrypted files are not symbolic or hard links to other files, but I have never seen 0 file size (obviously I am not a computer expert).
Cryptomator encrypts data on the fly, i.e. on every access, to exactly avoid storing your data unencrypted on storage. Still, caching is used to increase performance, but the caches are kept in volatile memory only, specifically in the memory assigned to the Cryptomator process by your OS.
What you see is just a decrypted view of your encrypted files. This is possible because Cryptomator implements its own filesystem, which acts as a translation layer between encrypted storage and decrypted view.
I don’t know why the du tool shows a file size of 0, it may be related to the fact, that Cryptomator uses FUSE to integrate its filesystem in the surrounding os.
ls -s, du -s report 0.
But ls -l does report the expected size.
I tried with gocryptfs and encfs and they report the correct sizes (ls and du). They present a completely normal mount to the system, meanwhile cryptomator presents some ‘magic’ files of 0 size (just like those in /proc/).
This behaviour breaks compatibility with scripts and other applications which rely on querying file sizes.
This is also reproducible using the MirroringFuseMountTest. It is interesting too, that Veracrypt (which also uses fuse to mount the vault content into the system) displays for every file Blocks: 8 which results in ls -s or du -s of each file = 4
yeah. Thats the reason. I get the same stats. Size is good but Allocated Block size is 0 so applications like Thunar (file manager) fail whenever im accessing the decrypted directory. Its should at least fake it otherwise applications get confused.