Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

I need to generate a 1024 bit ElGamal key on Android, and key generation takes forever (~10 minutes on a Galaxy Nexus), I suspect because it take so long to generate a safe prime.

Is it dangerous for me to use the same safe prime p for all devices using my app?

Where can I find a list of 1024 bit and 2048 bit safe prime numbers?

I'm using it for encryption, and I'm wary about hard-coding a P/G because of the this attack. I know it says only for signatures, but I'm still wary of introducing weakness because I am by no means an experienced cryptographer. The IETF has a list of good Ps to use, but they advocate using G=2, as seen here.

share|improve this question

migrated from stackoverflow.com Nov 30 '12 at 17:22

This question came from our site for professional and enthusiast programmers.

    
Any reason why you want to use ElGamal over Diffie-Hellman, DSA or Schnorr signatures? Are you talking about ElGamal encryption or ElGamal signatures? –  CodesInChaos Nov 30 '12 at 12:21
    
What's wrong with G=2? If you can decrypt ElGamal encrypted messages with base 2, you can decrypt ElGamal encrypted messages with any base (assuming you use a safe prime; one with (p-1)/2 prime). –  poncho Dec 3 '12 at 0:49

1 Answer 1

With most finite field crypto using a standard group is no problem. I think ElGamal encryption doesn't have any specific requirements for group or generator that plain Diffie-Hellman doesn't have.

So you could look into RFC 2409 Internet Key Exchange or RFC 5114 Additional Diffie-Hellman Groups for Use with IETF Standards for groups.

AFAIK ElGamal signatures have some additional requirements for the generator, so the above groups are probably a bad idea. But I wouldn't use ElGamal signatures in the first place, preferring DSA or Schnorr.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.