cryptomator / cryptofs

Java Filesystem Provider with integrated encryption
GNU Affero General Public License v3.0
93 stars 35 forks source link

Store (encrypted) DirectoryID inside of ciphertext directory #113

Closed infeo closed 2 years ago

infeo commented 3 years ago

With CryptoFS 2.1.0 exists a possibilty to restore orphaned directories. The only downside of this method (and also other health fixes of Diagnostic Results) is, that the for the fix important dirId is not present by looking only at the encrypted vault structure and hence all files inside the orphaned dir need new, arbitrary names.

After implementing #47, this problem can be solved by storing the directory ID within the dir node itself, simplyfing the retrieveal if the dirID and making also more fixes possible.

overheadhunter commented 3 years ago

Or alternatively (since xattr may not survive sync) we can store it in a dedicated file inside the dir. This may need encryption to prevent attackers to descramble the dir structure.

infeo commented 2 years ago

Regarding encryption: The dirId can be encrypted with the masterkey and the rootDir as AD. That way, we can always decrypt it and it is has the same protection level as everything else.

overheadhunter commented 2 years ago

and the rootDir as AD

can you explain what purpose this serves?

infeo commented 2 years ago

can you explain what purpose this serves?

The intention was to unify some code, but a short research and talk showed me, this is completely unnecessary^^