Challenges
Modular inverse
Cryptography
Easy
Modular inverse
Solves: 8
Modular inverse
Author: CyberSamSU
Points
15
In modular arithmetic, there is no division operation. Instead, you multiply by the "inverse element". The inverse of a modulo mod p is such a number d that a · d ≡ 1 (mod p).
The inverse element exists only when EKUB(a, p) = 1. If p is a prime number, there is an inverse for every number except 0. There are two ways to find it: the extended Euclidean algorithm or Fermat's Little Theorem — d = a^(p-2) mod p.
Find the inverse of the following a modulo mod p.
p = 947291647
a = 690678758
Answer: only a number — in decimal format, without spaces and additional characters (for example 1234).
Theory: learn the topic
To submit a flag, log in.