if $a b \bmod n = x$ then is it true that $x b \bmod n = a$? I am a student of computer science and I'm doing cryptography; I need to optimise the way I calculate modulus.
What I'am doing is like this:
$$14 \cdot 16 \equiv 3 \bmod 17$$
$$3  \cdot 16 \equiv 1 \bmod 17$$
My question is if that is true for all numbers.
My goal is to know if this is true so that once I calculate $14 \cdot 16 \equiv 3 \bmod 17$, I can derive the result of $3 \cdot 16 \bmod 17$ without doing all the work.
Also, Is this true for "power modulus"? I mean

if $a^d \equiv b \bmod{n}$,
  is $b^d \equiv a \bmod n $?


In more common notation, what you're saying is this:
"Is it true that $ab \equiv x \pmod n$ implies $xb \equiv a \pmod n$?"
This is not true in general. A counter-example is given by letting $n=4$, and $a=b=2$ and $x=0$. Then $ab \equiv 0 \pmod 4$, but $0 \cdot 2 \not \equiv 2 \pmod 4$.
