Both the Fiat-Shamir Zero-Knowledge Protocol and the RSA public-key
cryptosystem involve computing powers in modular arithmetic.
We will start out with a simple example, the powers of 3 modulo 19.
Instead of entering things like 317 on our calculator, we shall
build up slowly, each time multiplying the previous result by 3:
Our example, shows a few things that are true in general. First, it is very easy to compute modular powers, since our numbers can always be reduced to less than the modulus m. Secondly, the actual values tend to wander around the numbers from 1 to m-1, but they always eventually repeat. One thing we wish to learn here is how long is before the powers repeat. Since the 0-th power is always 1, that comes down to determining the smallest positive integer k such that the k-th power is congruent to 1. Then the cycle of powers will repeat every k powers.
To be a little more general now, let m be the modulus and let a be
the number that we are raising to a power. So we are considering the
powers
.
If
,
then ak-1 is a
multiple of m. Suppose ak-1=lm for some integer l.
That says one very important thing about the relation between a and
m: they have to be relatively prime. If not, there would an integer
d>1 that divides both a and m. That is the same as saying
.
Then, since ak-1=lm, we conclude