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 $?


If $x\equiv a\cdot b\pmod n$ 
and $x\cdot b\equiv a\pmod n\implies x\equiv b^{-1}\cdot a\pmod n$
$$\implies a\cdot(b-b^{-1})\equiv0\pmod n$$ which is not true in general.
If $(a,n)=1, $ we need $b-b^{-1}\equiv0\pmod n\iff b^2\equiv1\pmod n$ assuming $(b,m)=1$

If $a^d\equiv b\pmod n$ and $b^d\equiv a\pmod n$ 
$\implies (a^d)^d\equiv a\pmod n\implies a^{d^2}\equiv a\pmod n$
If $(a,n)=1, a^{d^2-1}\equiv\pmod n$
$\implies ord_na$ needs to divide $d^2-1$ which is not true for all $d$
