How to calculate the mod value of a rational/irrational value? We have a course in network security this semester and we are being taught RSA algorithm.

I came across a typical math problem that I was unable to solve here.

$$D*E \equiv 1 \mod{\phi(n)}$$

This became $$D \equiv E^{-1}  \mod{\phi(n)}$$ How do you solve this ???

My lect gave this specific example 

$$D \equiv 7^{-1} \mod{160}$$ and the solution for $D$ was $23$! How did she arrive at this.
Hint

$7D = 1 \mod 160$ 

Sol'n 


  $7D = 1 \mod 160$ and $D = 23 \Longrightarrow 23*7 \mod 160$ satisfies this.
https://www.youtube.com/watch?v=mgvA3z-vOzc
Check this out. The problem can be solved using extended Euclidean Algorithm to be precise. For smaller numbers, the answers already mentioned are sufficient.