8

I have a message encrypted with the public key. Metamask has its corresponding private key (account). How can I decrypt it with the metamask? Does metamask provide such feature?

What I meant is just like while performing the web3.eth.sign function, metamask provides us the window to sign a message does it also provide some functionality to decrypt a message?

In my application server stores a code (text) encrypted with user's public key. In the client side (javascript) user first needs to decrypt this code to do some task. So, either I prompt user to enter its private key (which is considered a bad practice) or I use some wallet or account management like Metamask.

Please suggest.

1
  • Metamask does not have a feature for what you've described. Maybe provide more context :) ? May 23, 2018 at 19:24

2 Answers 2

6

Looks like Metamask added functionality for this.

You can use their following API commands: getEncryptionPublicKey(address) & decryptMessage(address, data)

3

Currently, Metamask doesn't provide any such functionality. A discussion is going on to make some relative update. You can stay tuned: https://github.com/MetaMask/metamask-extension/issues/1190

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.