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

[Proposal] add encryption capabilities #101

Open
4 tasks
mirceanis opened this issue Dec 12, 2024 · 0 comments · May be fixed by #102
Open
4 tasks

[Proposal] add encryption capabilities #101

mirceanis opened this issue Dec 12, 2024 · 0 comments · May be fixed by #102
Assignees

Comments

@mirceanis
Copy link

The snap-specific entropy used to sign messages can also be used to derive an encryption key-pair.
The secret decryption key should not be the entropy, to avoid key reuse, but it has to be deterministically generated from it.
To align with other MetaMask implementations, the encryption system should use ERC1024 messages and keys.
See here an implementation.

  • add a getEncryptionPublicKey(): Promise<string> method that returns a hex encoded, 0x prefixed x25519 public key
  • add a decryptMessage(message: Eip1024EncryptedData): Promise<string> method that accepts an Eip1024EncryptedData object and returns the decrypted message (string).
  • add corresponding logic to onRpcRequest to expose the 2 new methods
  • If possible, avoid using extra dependencies
@mirceanis mirceanis self-assigned this Dec 12, 2024
mirceanis added a commit that referenced this issue Dec 12, 2024
@mirceanis mirceanis linked a pull request Dec 12, 2024 that will close this issue
mirceanis added a commit that referenced this issue Dec 12, 2024
mirceanis added a commit that referenced this issue Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant