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

There's a program that uses the following OpenSSL function...

DH_generate_parameters(256, 5, NULL, NULL) create DH parameters which are later used for hundreds of key exchanges (and the one-time keys used to encrypt login details sent over Internet).

The manual page says 256 is prime_len in bits. How secure is this value? (I have a bad feeling.)

Also, if I'm reading, does this correspond to "discrete logarithm key" or "discrete logarithm group" or am I looking in the entirely wrong place?

share|improve this question
By the way, you don't need to generate your own parameters. You can use, for example, get_rfc3526_prime_2048 to load some standard ones. – Matt Nordhoff Jun 21 '14 at 22:37

I'm guessing whoever made the program was confused about key lengths. A 256-bit DH modulus will not give 256-bits of security. It will provide far less.

If you're reading, the value here corresponds to the "discrete logarithm group". These days you really want a minimum of 2048 bits.

share|improve this answer

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.