Is there any way to generate values only between $0$ and $255$ with the Diffie-Hellman method? I need to create keys for communication algorithms with $32$ and $16$ numbers between that range.
The idea is to exchange the keys between the participants using the results of the Diffie-Hellman key agreement algorithm. Then we create the keys on the clients side, so they can use the keys.
Letting $x$ be any number, $$3^x \bmod 17 = W$$
$W$ can be any number between $0$ and $17$. I need $W$ to be a number between $0$ and $255$.