Skip to content

Add web3.eth.encrypt method for RPC & web3 #130

@danfinlay

Description

@danfinlay

Update: Parity Implemented

This EIP now recommends that the Parity methods encryptMessage and decryptMessage be added to the personal namespace.

https://github.com/paritytech/parity/wiki/JSONRPC-parity-module#parity_encryptmessage

Below is the original post, which is less refined. Below that is the full discussion.

Specification

Option 1: Add a new method, encrypt(account, data, [cb]), and decrypt(account, data, [cb]) or something else, that allows a user to encrypt & decrypt arbitrary lengths of data with an account's private key, as well as clarify the documentation of eth.sign.

Option 2: Clarify to current implementations that eth.sign should work for arbitrary lengths of data, not only with sha3 hashes, as well as add an encrypt method.

Rationale

Currently there is a web3.eth.sign method that is described as a general signature method in the wiki, but in practice, implementations have made it a de-facto signHash method.

There is still a valuable place for a method to sign and encrypt arbitrary data with an account's private key (or an arbitrary public key). For example, using an account's private key can be used to encrypt private data that is stored in public, like personal data. A recent casual example would be saving wallet nicknames in a secure way, but obviously more serious examples abound, including potentially medical data.

To reconcile the current lack of a general purpose data signing method, I recommend we either endorse a new method or change the old. Since applications exist and already rely on the current eth.sign, that's probably an inconsiderate option, so I personally think a new method is in order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions