I'm implementing an SRP-6a login system. What security checks do I need to do? Note that the modulus is sent to the client at algorithm startup.
Here is the list I have so far. I'm using the Wikipedia names for the variables.
- Verify that $N$ is an appropriate size.
- Verify that $N$ is prime.
- Verify that $q = \frac{N-1}{2}$ is prime.
- Verify that $g$ is a generator of $(\mathbb{Z}/N\mathbb{Z})^\times$ by verifying:
- $1 < g < N-1$
- $g^q = -1 \pmod N$
- Verify that $0 < A < N$.
- Verify that $0 < B < N$.
- Verify that $u \neq 0$.
- The server should not send its proof before the client provides its valid proof.
Regarding the primality checks, what algorithm should I use? Should I randomize the parameters during the primality check in order to prevent a false server from finding a composite that passes what the client checks?