meld-cp / obsidian-encrypt

Hide secrets in your Obsidian.md vault
MIT License
563 stars 33 forks source link

How to decrypt in bulk? #105

Open frontc opened 1 year ago

frontc commented 1 year ago

I suggest adding a bulk decryption feature to remove the encryption association between encrypted notes and Obsidian. Users would be able to decrypt notes without using Obsidian and generate unencrypted Markdown files. This would also fulfill the potential future need to migrate away from Obsidian. Please consider this suggestion, and I look forward to your response.

geneorama commented 5 months ago

I think this should be merged with #131, and #131 should be closed as a duplicate.

Users would be able to decrypt notes without using Obsidian and generate unencrypted Markdown files.

I believe this part of the issue implies a command line interface.

meld-cp commented 4 months ago

I've started working on a node cli tool. Does anyone have time to test with a test vault?

ERamseth commented 2 months ago

I've started working on a node cli tool. Does anyone have time to test with a test vault?

I will help test.

meld-cp commented 2 months ago

Thanks @ERamseth , I'll aim to add some information this weekend

meld-cp commented 2 months ago

Hi @ERamseth , thank you for offering to test

To test:

  1. Install Nodejs
  2. download mdenc-debug.mjs
  3. Create a test vault with some encrypted notes (whole and inline) along with some unencrypted notes
  4. run the tool whilst in the test vault directory:
    
    > cd \my-test-vault
    > node <somepath>\mdenc-debug.mjs

Usage: mdenc-debug.mjs [command] [options]

Commands: mdenc-debug.mjs list list all encrypted artifacts within the current directory mdenc-debug.mjs test check that all notes can be decrypted with the given password list [aliases: check] mdenc-debug.mjs decrypt decrypt notes to plain text given a password list and an output directory

Examples: mdenc-debug.mjs list Processes all .md and .mdenc files and list any encrypted artifacts within the current directory mdenc-debug.mjs test --passwords pw1 pw2 check that all notes can be decrypted with the given password list mdenc-debug.mjs decrypt --pw pw1 pw2 --outdir \path\to\output\ decrypt notes to an output directory

Not enough non-option arguments: got 0, need at least 1

ERamseth commented 2 months ago

Hi @ERamseth , thank you for offering to test

To test:

1. Install Nodejs

2. download [mdenc-debug.mjs](https://github.com/meld-cp/obsidian-encrypt/blob/next/tools/mdenc-debug.mjs)

3. Create a test vault with some encrypted notes (whole and inline) along with some unencrypted notes

4. run the tool whilst in the test vault directory:
> cd \my-test-vault
> node <somepath>\mdenc-debug.mjs

Usage: mdenc-debug.mjs [command] [options]

Commands:
  mdenc-debug.mjs list     list all encrypted artifacts within the current directory
  mdenc-debug.mjs test     check that all notes can be decrypted with the given password list  [aliases: check]
  mdenc-debug.mjs decrypt  decrypt notes to plain text given a password list and an output directory

Examples:
  mdenc-debug.mjs list                                            Processes all *.md and *.mdenc files and list any encrypted artifacts within the current directory
  mdenc-debug.mjs test --passwords pw1 pw2                        check that all notes can be decrypted with the given password list
  mdenc-debug.mjs decrypt --pw pw1 pw2 --outdir \path\to\output\  decrypt notes to an output directory

Not enough non-option arguments: got 0, need at least 1

This all seemed to work great. I think maybe picking note by note is better, but this could of course be achieved by just moving single files to a directory.

meld-cp commented 2 months ago

Thanks for testing @ERamseth, good idea, I'll look into adding a 'path filter/pattern' option