Recover $m$ from $k = n \mod m$ when $k$ and $n$ are known

38 Views Asked by At

I was wondering if there is a quick way how you could find (calculate, bruteforce) $m$ in $k = n \mod m$ if you know $k$ and $n$.

1

There are 1 best solutions below

0
On BEST ANSWER

The one and only thing you can say is that $m$ divides $k-n$. (Depending on how you define modulo, we also have $m>n$). Noting more can be gleaned from the given information.

For instance, $15\equiv 1\pmod m$ gives us that $m$ is either $2,7$ or $14$.