-
Notifications
You must be signed in to change notification settings - Fork 539
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
Slow Public Key Generation #673
Comments
I'm going to assume that no one else really knows why as well. |
The parameter
(Or alternatively, what PyCryptodome does:)
As already finding a single prime with the given size takes quite a time, finding a safe prime takes significantly more time. You can try to run See also the following profile of
I do not know if it has downside to (re)use a pre-generated safe prime. Nevertheless using |
If that's the case and it is indeed working fine..what would be the estimated time I'd have to wait before a key gets generated? Also using the command you have provided does go faster. 4098 is still unknown as it took to long before I just cancelled it. Anything less than 4098 went quickly and moderately fast. |
I am afraid the code is simply very slow, and speed degrades exponentially with the bit size. However, I don't think it is worthy - ElGamal keys should not be used in the first place. Support for ElGamal remains available purely for legacy reasons. I will therefore close this issue. |
Introduction
So, As the title says, I am trying to generate a key using the following.
key = ElGamal.generate(4098, Random.new().read)
And it's been about an hour now and it still isn't done..
I am using pycryptodomex as perhaps maybe it'd be a bit faster or maybe something would be different, but I can confirm that it doesn't matter if I use pycryptodome or pycryptodomex. It's just not generating a key.
Here is my code:
What I am trying to achieve here is an encrypted message (just playing around with stuff). And a decrypted message.
However, I am never able to get to the rest of the code to be able to test things and mess around as the key just never generates.
Any info on why this may be the case would be very helpful and if you have any ways to fix this, It'd also be really helpful and i'd appreciate it.
Extra info:
version:
System Info: (from neofetch)
The text was updated successfully, but these errors were encountered: