Unable to decrypt files with sanitizer

Hey there, I was wondering if there was anyone who could maybe help me with this error while trying to decrypt my files. I’m not the most tech-savvy person, so maybe this is a simple fix. I’m afraid my files may be lost for good, any help would be greatly appreciated!

Vault password:
Enter absolute path of an encrypted file: A:\b\Folder\d\EM\M2PMHI3DCF4TKO3MYH4QH47OY3WL2Q\6A_cwcsDHIf-yKDBTcWHyXu4VqWUlUxK62rRZHDblbx77gRqq1dQkcfDOYGua6sM-xE2-w==.c9r
Enter absolute path of decrypted output: C:\Users\Jim\Desktop\decrypt

Exception in thread "main" java.lang.IllegalArgumentException: Unsupported vault version 7
        at org.cryptomator.sanitizer.CryptorHolder.bestGuessCryptorProvider(CryptorHolder.java:91)
        at org.cryptomator.sanitizer.restorer.FileDecryptor.decryptFile(FileDecryptor.java:36)
        at org.cryptomator.sanitizer.commands.DecryptFileRunner.run(DecryptFileRunner.java:21)
        at org.cryptomator.sanitizer.commands.DecryptFileCommand.run(DecryptFileCommand.java:79)
        at org.cryptomator.sanitizer.commands.Commands.run(Commands.java:75)
        at org.cryptomator.sanitizer.Sanitizer.main(Sanitizer.java:16)
        at java.base/java.util.Optional.ifPresent(Optional.java:176)
        at org.cryptomator.sanitizer.Sanitizer.main(Sanitizer.java:12)

Sanitizer can not (yet) handle the latest vault version 7.

There is the plan to integrate its functions into the Cryptomator app rather than updating sanitizer. But this could take some time.

Hey there Michael, I really appreciate the speedy reply. Although I suppose this is somewhat good news, do you know if there is anything I can do at all to recover my encrypted files in the meanwhile? I’m not exactly familiar with file encryption and how Cryptomator works in general. I noticed yesterday after creating a vault, everything was going smoothly, but after closing and reopening the application, my vault location was no longer valid. I’m sure I sound like a complete dunce, but I lost some very sentimental photos, so anything that could help at all, please let me know.

Do you still have the vault folder (Masterkey file inside and a folder “d“ with several subfolders and encrypted files)?
If yes, can you please delete the vault from Cryptomator (this will not delete the files from your local storage).
After that please use the „add existing vault“ function and select the Masterkey file of your vault to connect the vault with Cryptomator again.
Dos this work?

This is where it gets a little complicated, I noticed that my vault that I created on partition “A”, no longer had anything but the folder “d” in it, with all of my encrypted files, just no master key. Although, my other vault in partition “C” located in my documents folder had two files (as well as a d folder), one being a master key, and the other being a master key backup. Both of which were created a few hours apart from each other. So I took the master key back up, and put it into my partition A folder, and proceeded to open it with my password. It opens up, but it basically is just an empty partition with no files. I’m trying my best to make sense out of this whole situation, but I’m finding it rather difficult LOL - but once again, thank you and I really appreciate your time.

No, you cannot use the Masterkey files in different vaults. (If you do so, Cryptomator cannot encrypt anything from that vault and that’s why it is shown empty)
You’ll have to find/restore from bin the Masterkey file that was formally in your vault on A.
If it was deleted by accident, you should find it in your recycle bin.
If you had an online sync enabled for this vault, please look also online and/or in your online recycle bin.

If you can’t restore this Masterkey file, I’m afraid your data is lost (assuming you do not have a backup of the files in the vault you can restore)

I figured, well, unfortunately I’m unable to find the masterkey that applied to that vault, I’m really unsure on how it disappeared. So it looks like it may be worst case scenario. My last question would be, should I hold onto the files until an updated version Cryptomator is released? As you were stating before, there’s an update on integrating something like “sanitizer” into the application itself. Once that comes around, would my files potentially be recoverable? Thanks again!

Unfortunately no. Without the corresponding Masterkey, there’s no decryption possible anymore. (also not with sanitizer functions)

It depends on your system how to proceed but sometimes you can restore files even when they aren’t in the recycle bin anymore. There are a lot of tools which could be used but as I said it depends on your system and there is no guarantee that it will work at all but in this case it is probably a worthwhile effort to try it out.

I appreciate the help guys, I’m currently using some recovery software in hopes of scraping up anything useful, hopefully it works out. If not, I’ll just need to take the L on this one. Thanks again for the information!

Hey there, so I recovered every masterkey that was deleted from my computer, and I believe one of these must be the correct masterkey. My question is how exactly do I know which one will decrypt the files, and how do I do so? Sorry in advance for my ignorance, but thanks again! https://i.imgur.com/3Oy1oqV.png

1st of all: Cryptomator does not create Masterkey files with „_2“ or „_3“ and so on, but sync clients do numerate files if they detect a conflict. Or backup software if you have enabled keeping file versions.
If you do not use such backup software then you should check your sync setup.

Back to topic:
I would just try the files one by one.
Rename it to „masterkey.cryptomator“ and store it in you vault (the „A“ Vault) in the root directory of your vault (where the „d“ folder is).
Then try to open your vault.
If the Passwort is accepted but the vault appears to be empty: wrong Masterkey file
If the password is not accepted: wrong Masterkey file.
If the password is accepted and the unencrypted files are shown: jackpot.

(At least I do not know any other way to do it)

To shorten the try and error process, you can run a file comparison with a suitable app and exclude all Masterkey files that match the one in your vault that’s working fine (because this Masterkey cannot be the one for your problematic vault)

1 Like

Alright awesome, I’ll give all of them a try, I’ve had some where the password is accepted and it just opens a blank partition which I was confused about, so thanks for clearing that up! Also do I need any other files than just the masterkey and “d” folder?

So, some of the keys would open it and show nothing inside (as expected), but the keys that I suspect are the correct master keys come back with an error that I thought would be worth noting.

java.io.IOException: Malformed masterkey file A:\b\Folder\masterkey.cryptomator
	at org.cryptomator.cryptofs.migration.Migrators.needsMigration(Migrators.java:86)
	at org.cryptomator.common.vaults.VaultListManager.determineVaultState(VaultListManager.java:118)
	at org.cryptomator.common.vaults.VaultListManager.create(VaultListManager.java:86)
	at org.cryptomator.common.vaults.VaultListManager.add(VaultListManager.java:64)
	at org.cryptomator.ui.launcher.AppLaunchEventHandler.addVault(AppLaunchEventHandler.java:70)
	at java.base/java.util.ArrayList.forEach(Unknown Source)
	at org.cryptomator.ui.launcher.AppLaunchEventHandler.lambda$handleLaunchEvent$1(AppLaunchEventHandler.java:58)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Unable to parse key file.
	at org.cryptomator.cryptolib.api.KeyFile.parse(KeyFile.java:89)
	at org.cryptomator.cryptofs.migration.Migrators.needsMigration(Migrators.java:83)
	... 13 more
Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 32 path $
	at com.google.gson.JsonParser.parseReader(JsonParser.java:66)
	at org.cryptomator.cryptolib.api.KeyFile.parse(KeyFile.java:80)
	... 14 more
Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 32 path $
	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1564)
	at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1405)
	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:543)
	at com.google.gson.stream.JsonReader.peek(JsonReader.java:426)
	at com.google.gson.JsonParser.parseReader(JsonParser.java:61)
	... 15 more

Seems your key file is damaged.
Now it get technical.
@SailReal do you have an idea?