Public/Private Key encryption/decryption with wallet

dappsencryptionprivate-keypublic-keywallets

The following case:

There is a dApp in place, connected with a wallet (e.g. Metamask). Wallets usually don't offer public/priate key encryption/decryption.

I want to decrypt a message for the owner of an address, using the recipient's public key. The recipient then decrypt's the message using his private key. However, the wallets today are limited to sing messages.

Is there a possibility to encrypt/decrypt messages using today's wallets?

Best Answer

Metamask provides: eth_decrypt and eth_getEncryptionPublicKey.

Together with eth-sig-util should help encrypt and decrypt messages.

Related Topic