nb icon indicating copy to clipboard operation
nb copied to clipboard

Crypt using GPG key

Open Marthym opened this issue 5 years ago • 4 comments

Maybe it can be great to encrypt using specified GPG key

This will avoid to retain multiple password

Marthym avatar Oct 20 '20 14:10 Marthym

Yeah, I have a lot of ideas around this. I'm aiming to have different encryption and authentication strategies implemented as plugins. The API should be basically there. I like keeping simple, clear file encryption as the baseline in the core. I feel like it should be possible to implement just about anything around encryption, passwords, and keys as plugins with no more than small hook in the _encrypt_file() and _decrypt_file() functions.

If anyone else wants to try implementing plugins around this, this would be a good area to contribute. I'd recommend implementing a plugin in the plugins directory.

xwmx avatar Oct 26 '20 17:10 xwmx

With the current implementation wouldn't a plugin need to override the encryption and decryption functions?

Would it make sense to add encryption methods like subcommands are added? It could look something like this

_encryptions add "gpg"

_encrypt_gpg() {
}

_decrypt_gpg() {
}

You would also have to be able to extend the logic that determines the encryption method of an existing file. Technically I guess it could try every decryption method until it succeeds.

oliryde avatar Nov 10 '20 13:11 oliryde

I think this would be a great idea. Maybe it could get inspiration from pass encryption system. Also, in a multiple users scenario, this system would enable multiple keys to access to the notes.

raspbeguy avatar Nov 27 '20 09:11 raspbeguy

+1 for (at least) some sort of master password support.

Using nb for simple encryption workflows feels like a natural extension. Though, it looks as if such features will only be available through some community support. I don't think the project has a roadmap yet right? This sounds useful given the different feature requests and pending improvements (as good as the current state of the tool already is).

realshovanshah avatar Dec 06 '23 11:12 realshovanshah