Recovering deleted encrypted notes (either undeleted or from note history)

Looking for input and/or verification of my understanding of my current situation.

Current OSes and Joplin versions are as follows

Joplin mobile (v1.0.329, Database v29) - Android Galaxy J7
Desktop (v1.0.201) - Windows 10

Tried to set up 2 Joplin instances w/ sync on my own webdav server. Entered lots of notes on mobile from other apps, deleting from the old apps as I went, then enabled encryption. Forgot that password, decrypted, made a new one. Then did sync to webdav, and attempted to sync my desktop version (which had a few notes I entered on the desktop). Saw notes titled “Decryption” and - due to my own misunderstanding/confusion - deleted them in an attempt to get them to resync. Wound up deleting them all together across both devices. Had a backup of my desktop notes assuming something would go wrong, but got distracted while trying to do the same for mobile and forgot that I had not.

I shut off my webdav server immediately and ran an undelete on the unmounted drive. Recovered a bunch of notes (presumably the ones with the first encryption key, the ones with the 2nd, and some unencrypted). I presumably have the sqlite database still on my phone as well.

Is there some way to manually decrypt the undeleted files - with or without loading them into my Joplin instance - assuming I have the password? Which of the files contains the master key?

Also, regarding my mobile version, is it correct that I will have to root my phone to access that sqlite database? If the notes themselves were encrypted before deletion, will the note history be encrypted as well? If the undeleted notes dont work out, I should be able to recover my notes from the Notes History table of the sqlite db right?

With the CLI app, you can use the command e2ee --decrypt-file but you’ll first need to sync this client with your files in order to get the master key.

https://joplinapp.org/terminal/#commands

1 Like

Ah thank you.

I may wind up rebuilding my sync folder with some combination of the undeleted files to achieve this. Which of the files contains the Master key, though, so I can ensure it’s there before installing and syncing the CLI client?

You could grep for type_: 9 but I think it might be best to just sync the whole folder, making sure you have a backup in case something goes wrong.

1 Like