2

A geth node is managing an Ethereum account, having the control over its private key at keystore folder. I guess to keep it safe, best practices are letting geth by its own perform all operations that require access to the private key. Well, the case is I need to decrypt a message that was encrypted using the public key of the geth account, in order to be only readable by this account. So, is there any geth function via JSON-RPC capable of decrypting a message using the private key of the account? Something like this:

ECIES.Decrypt(account, message); 

The only other choice is left seems to be accessing directly to the keystore folder and decrypt the message using the private key there, but I don't feel comfortable doing so, it seems a quite insecure scheme, right?

Ref.:

How to encrypt a message with the public-key of an Ethereum address

2
  • I couldn't find any ECIES function at github.com/ethereum/wiki/wiki/JSON-RPC so I guess this (encryption/decryption) is not posiible to do using JSON-RPC protocol, right? Commented May 15, 2017 at 8:18
  • 1
    With Geth it isn't, with Parity it is – see my answer. Commented May 19, 2017 at 0:57

1 Answer 1

2
+50

You can't do that with Geth. However Parity does expose a module that does just that: see the parity_decryptMessage() function.

1
  • Thanks for the bounty Juan. Please don't forget to mark the answer as correct if it's what you were expecting. Commented May 23, 2017 at 1:17

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.