Multiplicative inverse of n mod m ((Euclidean algorithm))

[Back] In cryptography, we often need \(n^{−1}\), which is a multiplicative inverse of n mod m, i.e. \(n/(n^{−1}) = 1 \mod m\). It is used in the calculation of the decryption key in RSA, and in other cryptography methods. With RSA, we get (e x d) mod (N) = 1, where we have e and N, and must calculate d using the multiplicative inverse of n mod m.