Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to find a prime $p$ of $1024$ bits with a $160$ bit sub group size $q$, such that $q|p-1$ , and $g$ is the generator of the sub group size $q$.

I'm looking for the numeric values of $p$ , $q$ and $g$.

share|improve this question
What do you want to use those for? The requirements for those differ subtly with use. For example ElGamal signatures need a large generator. For most uses I'd just look up a set of group parameters in a DSA or DH standard. – CodesInChaos Feb 8 '13 at 15:35
To continue @CodesInChaos's comment, for DSA, you need q to be exactly a specified size (for example, precisely 160 bits). What do you need this for? – poncho Feb 8 '13 at 15:40
Hi , thanks to all of you . Im looking for those value for my project. q need to be 160 bit. i was looking in the rfc 2412. but i could not find the q that will produce me a subgroup is size of 160. – USer22999299 Feb 9 '13 at 9:36
up vote 1 down vote accepted

Suitable values are $q=2^{159}+9593, p=2^{1023-159}*q+1, g=2^{2^{1023-159}}\mod p$

I have checked the values given in section 2.1 of RFC 5114 and they seem fine too.

Whether "it's safe to use them" depends entirely on how they're being used, what you're trying to prevent, against whom and for how long and what the consequences of getting it wrong are.

share|improve this answer
Hi , im looking for subgroup size of 160. i was guided to look at the RFC 2412, but i couldn't find it. i found at RFC 5114 at section 2.1 page 4 , a well known p q and g . can you explain me if it safe to use them? thanks. – USer22999299 Feb 9 '13 at 10:20
@Barack You should merge your accounts. See – CodesInChaos Feb 10 '13 at 8:29

Your Answer


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.