Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect database encryption key with Electron safeStorage API #6849

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pl4nty
Copy link

@pl4nty pl4nty commented Apr 1, 2024

First time contributor checklist:

Contributor checklist:

  • My contribution is not related to translations.
  • My commits are in nice logical chunks with good commit messages
  • My changes are rebased on the latest main branch
  • A yarn ready run passes successfully (more about tests here)
  • My changes are ready to be shipped to users

Description

Protecting local user data has been discussed extensively in #5703 and elsewhere. I recently watched Claudia speak at CrikeyCon about offline recovery of Signal messages, relying on the plaintext encryption key rather than noisy live attacks like keylogging.

As a simple mitigation, I've implemented Electron's safeStorage API to opportunistically encrypt the key with platform APIs like DPAPI on Windows and Keychain on macOS. I'd love some feedback on this approach, particularly

  • Any additional features to accept this PR eg migration of existing plaintext keys
  • Whether the mitigated threats (eg offline analysis and low-privilege malware) are worth the user impact (password prompts) on Linux and macOS

CI has passed on my fork and installers can be downloaded here. I've manually tested startup, messaging, and restarts on

  • Windows 11 Education 22631.3374 (DPAPI)
  • Debian Bullseye in a devcontainer (basic_text)

Uses operating system key storage, or plain text on unknown Linux desktop environments

Signed-off-by: Tom Plant <tom@tplant.com.au>
@pl4nty
Copy link
Author

pl4nty commented Apr 11, 2024

I've also implemented AppX packaging on a separate branch, which provides filesystem isolation on Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants