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

Safer key storage in the browser #13

Open
joepio opened this issue Feb 20, 2021 · 1 comment
Open

Safer key storage in the browser #13

joepio opened this issue Feb 20, 2021 · 1 comment
Labels

Comments

@joepio
Copy link
Member

joepio commented Feb 20, 2021

The decentralized architecture of Atomic Data dictates that changes to information (Commits) are signed using the private key of an Agent (user). This means that, if we want to edit things from the browser, the browser app needs to sign commits using that private key.

Attack risks of current implementation:

  • Thief could wait until user leaves desk, go to agent settings, copy the secret / mail it / send it / photograph it. This could be preventable by making the secret only copy-able on creating the Agent, and locking it afterwards.
  • Thief could check localStorage on same browser, even after the session.
  • Thief could navigate the JS state / the react tree and find the private key value

Possible solutions

I want both a good UX, and a safe solution. Some thoughts:

  • Storing the key anywhere where JS has access (localstorage, indexedDB), means that all libraries of Atomic Data Browser have to be trusted.
  • The CryptoKey browser API seems interesting. It saves to indexedDB, but in a way that the key itself cannot be retrieved - it can only be used for signing things. I don't think it supports ed25519 signatures, which kind of sucks, because that's what I'm using in this project and the rust implementation of atomic data.

Some resources to check out::

@joepio
Copy link
Member Author

joepio commented Jan 17, 2023

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

No branches or pull requests

1 participant