Skip to content
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

Make encryption algorithm efficient enough to work quickly with larger numbers of encryption bits #37

Open
nickboucher opened this issue Jun 14, 2019 · 2 comments

Comments

@nickboucher
Copy link
Member

nickboucher commented Jun 14, 2019

  • Perhaps prime generation could be faster. Could be slow because 2 unique safe primes are needed. Should do more profiling, as is much slower than standard GMPY2 prime generation calls.
  • Random number generation appears to be very slow. Perhaps could pre-generate lists of random numbers or parallelize randomness. Be careful with how child processes are seeded; sometimes in Python child processes use the same randomness seed as their parent.
@swansonk14
Copy link
Member

I spent some time googling around for faster safe prime generation, and it seems like in general safe prime generation is much slower than single prime generation due to the requirement that p=2q+1 is also prime (which happens less and less often as the number of bits grows).

I did find one note describing a way to speed up safe prime generation: https://eprint.iacr.org/2003/186.pdf. However, given that our current method uses gmpy2 which is coded in C and that we would be implementing any alternative methods in Python, I think there's a good chance that we won't actually be able to produce a faster implementation.

Conclusion: Safe prime generation might just have to be slow. But at least it's a one-time cost and can be done independently prior to running the Shuffle-Sum algorithm.

@ProExpertProg
Copy link
Member

Looks like some good ideas. Why are we limited to using python? We could just take gmpy2 and extend it to use this method, if it doesn't already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants