-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comparison to your classic elgamal repository #8
Comments
That's a fair point @numtel, and that's the reason that motivated me to try to do the classic ElGamal implementation on Circom.
|
Thanks for the response. This is definitely at the limit of my mathematical understanding but I've read through this linked notion page. Pollard's rho seems like the biggest potential vulnerability? Seeing the potential attacks listed was very helpful because in my calculations, a brute force attack was infeasible. Of course, circom limits the key size to the field element size but I think I was wondering if it were possible to split a longer key into multiple encryptions if necessary. Although the ciphertext doubles the plaintext length with each encryption, it seems possible albeit cumbersome. Some backstory about my application: At the Bogota 2022 hackathon, I was on the Ethereum Social Contract team. After what had gone down with OFAC and Tornado Cash, we wanted to make a legally-compliant mixer (by allowing a single very private key [like as secret as the ICANN DNS key] access to decrypt transactions) but I had no clue at the time how to implement it. We need a method of proving that a ciphertext corresponds to a particular plaintext value encrypted by a specific key. At this time, I see using the encode/encrypt circuits from this repo added to a fork of Semaphore v4 that also outputs the ciphertext and public key as part of its circuit's public signals. I've started trying to implement this but I'm running into the issue of the encoding done in javascript not matching the encoding done by the circuit, since I'll be encoding the identityCommitment as the plaintext value. I don't know if I'm doing something wrong or if there is something missing here.
expect(prove_encode.publicSignals[0]).to.equal(encoded.x.toString());
expect(prove_encode.publicSignals[1]).to.equal(encoded.y.toString()); 🤞 Nice, ok continuing on semaphore fork... From your response, I gather that this repo is more secure than the classic version because of the EC used. As a result of this though, it limits the plaintext input to 32 bits. I think 32 bits of the identityCommitment would be enough for an MVP. Again, thanks so much for this work |
@numtel I am glad that my work is helpful to a fellow enthusiast.
I hope my work will be of more help to you and others :) |
Hello, I'm new to writing Circom circuits and was wondering about the security status of this repository versus the classic elgamal implementation repository.
As far as I can tell, both repos use 254 bit private keys so it seems like the warning about intentional insecurity should also apply to this code.
Is this correct? If so, is there a way to encrypt/decrypt using a larger 2048 bit key?
Thanks
The text was updated successfully, but these errors were encountered: