Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Cross-client Encrypt/Decrypt #9333

Closed
wants to merge 1 commit into from
Closed

Cross-client Encrypt/Decrypt #9333

wants to merge 1 commit into from

Conversation

topealabi
Copy link

@topealabi topealabi commented Aug 9, 2018

To encrypt

we obtain an encryption public key from the reciever

we generate an ephemeral key pair for the sender

we encrypt the message using the reciever public key and the ephemeral private key, and a nonce

We serialize to json and send over a a payload of the form:

const encryptedData = { version: 'x25519-xsalsa20-poly1305',
nonce: '1dvWO7uOnBnO7iNDJ9kO9pTasLuKNlej',
ephemPublicKey: 'FBH1/pAEHOOW14Lu3FWkgV3qOEcuL78Zy+qW1RwzMXQ=',
ciphertext: 'f8kBcl/NCyf3sybfbwAKk/np2Bzt9lRVkZejr6uh5FgnNlH/ic62DZzy' };

To decrypt

we use the receiver’s encryption private key and the ephemeral public key which is included in the payload as well as the nonce

Related to:
ethereum/EIPs#1098
MetaMask/eth-sig-util#18

With help from @javadevelopr

@parity-cla-bot
Copy link

It looks like @topealabi hasn't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence.
Wikipedia

You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io

Once you've signed, please reply to this thread with [clabot:check] to prove it.

Many thanks,

Parity Technologies CLA Bot

@topealabi
Copy link
Author

[clabot:check]

@parity-cla-bot
Copy link

It looks like @topealabi signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@dvdplm dvdplm added the A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. label Aug 14, 2018
@dvdplm
Copy link
Collaborator

dvdplm commented Aug 14, 2018

@topealabi It looks like this is work-in-progress at this time so I added the "inprogress" label. When you're ready for a review, let us know by adding the "pleasereview" label. Thanks! :)

@5chdn 5chdn added this to the 2.1 milestone Aug 23, 2018
@5chdn 5chdn added the M4-core ⛓ Core client code / Rust. label Aug 23, 2018
@5chdn
Copy link
Contributor

5chdn commented Aug 30, 2018

Are you still working on this?

@5chdn 5chdn added the A3-stale 🍃 Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Aug 30, 2018
@topealabi
Copy link
Author

topealabi commented Aug 30, 2018 via email

@5chdn
Copy link
Contributor

5chdn commented Sep 8, 2018

Ok, let's reopen this once you get back.

@5chdn 5chdn closed this Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. A3-stale 🍃 Pull request did not receive any updates in a long time. No review needed at this stage. Close it. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants