Key algorithm rsa. Extended euclidean algorithm.