$( x \cdot y ) \mod 37 = 1$ I am doing a paper for my security class. I have this equation which I'm trying to understand
                                  $$( x \cdot  y ) \mod 37 = 1 $$
e.g.  if  $x = 8$ and $y = ?$ ; which has to be the inversion of x . then y in this case is 14. 
My question is how do I solve an equation like this? and is it possible that value of $y$ is a negative number? if so, then an example would be great.
Thank you in advance !
 A: Instead of $37$ let's use a smaller number, $7$.  We have $xy \mod 7 = 1$ if the remainder of $xy$ upon division by $7$ is $1$.  Equivalently, if $xy-1$ is a multiple of $7$.
For example, $x=2, y=4$ satisfies $xy \mod 7 =1$.  This is also true if we replace either $x$ or $y$ by its sum with any number of $7$'s.  For example, $x=9=2+7, y=4$ still satisfies $xy \mod 7 = 1$.  We could just as well do $x=-5=2-7, y=4$ and still have $xy \mod 7 = 1$.  
If we know $x$ and want to find $y$, we may use the Euclidean algorithm to find a solution to Bezout's identity.  That is, we find integers $a,b$ such that $xa+7b=1$.  Now, you can see that $xa-1$ is a multiple of $7$, so the $a$ we found is actually the desired $y$.
A: Using this or this , $2$ is  a primitive root of $37\iff $ord$_{37}2=\phi(37)=36$
So, $2$ is a generator of this cyclic group $\mod {37}$
Now as, $\displaystyle2^{36}\equiv1\pmod{37}, 2^{-a}\equiv2^{37-a}\pmod{37}$
As, $\displaystyle8=2^3, 8^{-1}\equiv 2^{-3}\equiv2^{36-3}\pmod{37}$
Now, $\displaystyle2^5=32\equiv-5\pmod{37},2^6\equiv-10,2^7\equiv-20,2^8\equiv-40\equiv-3,2^{32}\equiv(-3)^4\equiv7$
$\displaystyle\implies 2^{33}\equiv2\cdot7\pmod{37}$
