Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Encryption proof #6

Merged
merged 13 commits into from
Nov 7, 2022
Merged

Encryption proof #6

merged 13 commits into from
Nov 7, 2022

Conversation

zwilling
Copy link
Collaborator

Encryption Proof circuit including:

  • private public keypair derived from ethereum key
  • MiMC encryption circuit (uses symmetric encryption)
  • ECDH symmetric key derivation from (sender's priv key and receiver's pub key == the other way around)
  • put together in encryptionProof.circom to show that the sender encrypted a msg correctly so that the receiver can read it

The tests work fine and should be enough for a prototype.
The security should be reviewed because I took the MiMC circuits and ECDH code from other github projects that are not audited and battle tested. (links in the code)

@zwilling zwilling self-assigned this Oct 31, 2022
@zwilling
Copy link
Collaborator Author

To be more specific about the things that should be reviewed in my opinion:

  • MiMC encryption. I took it from Adds MiMC encryption and decryption modes iden3/circomlib#16 because it was the only circuit I found for encryption that was also easy to integrate. It seems to work, but I am not sure about how secure it is. An alternative is Poseidon encryption and decryption iden3/circomlib#60 based on this spec. But it was much harder to integrate in the current version of circom.
  • Implementation of ECDH. The method seems to be solid (wiki page). But I do not know if the practical implementation is secure as well. It is inspired from this implementation in TypeScript and circuit.
  • MiMC uses a single signal as encryption key, but ECDH outputs a 2D point on the curve. Is it secure, that I just use the first coordinate of the point for the MiMC encryption?

@anhdungle93 anhdungle93 merged commit 60da0ea into main Nov 7, 2022
@zwilling zwilling deleted the encryption_proof branch September 8, 2023 09:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants