sanitizer icon indicating copy to clipboard operation
sanitizer copied to clipboard

Add support to Vault version 7

Open juanmbraga opened this issue 4 years ago • 8 comments

When trying to decrypt a vault with some files that Drive File Stream sent to lost and found, Sanitizer returns:

"Exception in thread "main" java.lang.IllegalArgumentException: Unsupported vault version 7 [...]"

Seems to be the same situation as this community post, so is it possible to add support for the newer version (7)?

juanmbraga avatar May 14 '20 16:05 juanmbraga

Yes, very important! Please add the support for v7.

cy2201 avatar May 14 '20 19:05 cy2201

We have plans to integrate plausibility checks into the main applications.

overheadhunter avatar May 14 '20 20:05 overheadhunter

Any advice on how to deal with version 7 vaults in the meantime?


UPDATE: I was able to make decryptFile work given that I had a version 6 masterkey.cryptomator.bkup file with the following instructions:

  1. Locate the vault directory (e.g. src/)
  2. Create a new empty folder (e.g. dst/)
  3. Copy src/d/ to dst/d/.
  4. Copy src/masterkey.cryptomator.bkup to dst/masterkey.cryptomator
  5. Run java -jar sanitizer-0.16.jar decryptFile -vault dst/

The other commands (i.e. check, decryptVault, encryptPath) did not worked though.


masterkey.cryptomator

{
  "scryptSalt": "...",
  "scryptCostParam": 32768,
  "scryptBlockSize": 8,
  "primaryMasterKey": "...",
  "hmacMasterKey": "...",
  "versionMac": "...",
  "version": 7
}

masterkey.cryptomator.bkup

{
  "scryptSalt": "...",
  "scryptCostParam": 32768,
  "scryptBlockSize": 8,
  "primaryMasterKey": "...",
  "hmacMasterKey": "...",
  "versionMac": "...",
  "version": 6
}

marcogrcr avatar Jun 29 '20 19:06 marcogrcr

I have at least four corrupted files (3x JPG, 1x MP4). Need this sanitizer really bad.

cy2201 avatar Sep 22 '20 10:09 cy2201

Apparently me too. Spent a lot of time isolating problems and have determined I have some corruption, and accordingly stumbled on this, and sadly discover I need the version 7 support.

お願いします。

permezel avatar Oct 28 '20 02:10 permezel

Not an expert on this, but I've forked and managed to make it work to check and decrypt the vault with version 7. I'm assuming that there are several things that I'm missing as it appeared to be an easy fix. As such, I'm not sure if I should open a PR or not.

This is the relevant commit: https://github.com/travellingfreak/sanitizer/commit/ec4ca00b25b680cf1699c97f3e1f1fcde24f4edf

meekyphotos avatar Feb 03 '21 09:02 meekyphotos

With vault format 7, huge parts of the vault structure changed. While it may still be possible to decrypt single files by merely updating the libraries, you can't check the integrity of the dir structure.

We're currently preparing integration of sanitizer right into the main desktop application and have already implemented the first checks. This is going to be a part of Cryptomator 1.6.0.

overheadhunter avatar Feb 03 '21 20:02 overheadhunter

Not an expert on this, but I've forked and managed to make it work to check and decrypt the vault with version 7. I'm assuming that there are several things that I'm missing as it appeared to be an easy fix. As such, I'm not sure if I should open a PR or not.

This is the relevant commit: travellingfreak@ec4ca00

This worked great for me to decyrpt folders and files! Worth forking the repo entirely and making a PR IMO. While it's probably not perfect, it's way better than nothing.

ijoseph avatar Apr 08 '21 18:04 ijoseph