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

Is it considered bad practice to use the same N and q parameters for all users in an SRP-6A based authentication system?

I know that q MUST be a Sophie Germain prime and N a safe prime, but can they be generated ahead of time and be somewhat fixed / hardcoded in the client and server? Or should I generate a fresh pair for each new user registration?

I imagine, it's better to have a different one for each account, but if it's not affecting the security of the system in any way...

share|improve this question
what is q? the parameters are usually defined as N a safe prime and g its generator which you can create from OpenSSL with openssl dhparam -text <bit-length> – simbo1905 Oct 10 '15 at 22:29
up vote 2 down vote accepted

You can pre-compute and hardcode N and g into your client and server. There's no harm in doing this. I do not believe that using per-user N will provide any additional security.

It is common practice to define SRP parameters for a particular application or (larger) protocol, see e.g. RFC 5054.

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.