cryptomator / cryptofs

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

Pass in external masterkey instead of reading it from vault dir #7

Closed overheadhunter closed 3 years ago

overheadhunter commented 7 years ago

If masterkey.cryptomator (or whatever it is called since version 1.1.0) is not located in the vault directory, there must be some other possibility to pass in the required data, such as a plain byte array.

This is needed in order to support storing the masterkey outside the vault.

markuskreusch commented 7 years ago

@overheadhunter Would either recommend to pass in a path (because the masterkey must also be written on initial creation of a cryptofs) or some object which may either read or receive and persist the encrypted masterkey contents somehow.

Would prefer the second approach and provide a default implementation operating on a path.

overheadhunter commented 7 years ago

Agree, so something like

interface MasterkeyFile {
  byte[] load();
  void save(byte[]);
}
Vesnyx commented 6 years ago

Doesn't seem like this has been worked on in a while, but couldn't modifying this and a few other areas where the "masterkey.cryptomator" is declared help fix this issue?

markuskreusch commented 6 years ago

An external masterkey would in fact require modifcations to the code you are referring too, but some additional tasks which make this more complex would have to be considered:

Workaround For now, experienced users may just use a long, generated password. A random password of 43 characters made of [a-zA-Z0-9] corresponds roughly to a 256-bit key.

overheadhunter commented 3 years ago

fixed in a041c5e