I am currently learning about the Diffie-Hellman key exchange. I understand that for a $g$ of $1$, the resulting key would always end up as $1$ which would obviously not be secure.
I read that the $p\! -\! 1$ value for $g$ is not secure either, but there is no explanation as to why - which is my question. I guess it has to do with $g$ being a divisor of $p\! -\! 1$ but I am not sure.