What is Fermat’s Little Theorem in Information Security?

Information SecuritySafe & SecurityData Structure

Fermat's little theorem is a fundamental theorem in elementary number theory, which provides compute powers of integers modulo prime numbers. It is a specific case of Euler's theorem, and is essential in applications of elementary number theory, such as primality testing and public-key cryptography. This is referred to as Fermat’s little theorem.

Fermat’s theorem is also called a Fermat’s little theorem defines that is P is prime and ‘a’ is a positive integer not divisible by P then −

aP−1 ≡ 1 mod P

Second condition says that if P is a prime and a is an integer then aP ≡ 1 mod P.

Proof − Zp is the set of integer {0, 1…P-1} when multiplied by a modulo P, the result includes all the element of Zp in some sequence, moreover a x 0 ≡ 0 mod P. Thus, the (P-1) numbers {a mod P, 2a mod P,…((P-1) a mod P)} are only the number {1, 2,…(P-1)} in some order.

Multiplying the numbers in both steps and taking the result mod P gives

         a x 2a x …. x ((P-1)a)= [(a mod P) x (2a mod P) x …. x ((P-1) a mod P)] mod P

                                           =[1 x 2 x…x (P-1)] mod P

                                           = (P-1)! mod P


a x 2a x…x ((P-1)a) = (P-1)!aP−1

   (P-1)! aP−1 ≡ (𝑃 − 1)! mod P

             aP−1 ≡ 1 mod P

Consider the set of positive integers less than p: {1, 2... p1} and multiply each element by a, modulo p, to receive the set X = {a mod p, 2a mod p . . . (p1) a mod p}. None of the elements of X is similar to zero because p does not divide a.

Furthermore no two of the integers in X are same. To see this, consider that (ja ≡ p) where 1 ≤ p1. Because p, it can delete a from both sides of the equation resulting in − j≡ p).

This final similarity is inaccessible due to j and k are both positive integers less than p. Therefore, it is understand that the (p1) elements of X are all positive integers, with no two elements same.

Numerical − Fermat’s theorem states that if p is prime and a is a positive integer not divisible by P, then aP−1 ≡ 1(mod p).

Therefore, 310 ≡ 1(mod 11).

Therefore, 3201 = (310)20 x 3 ≡ 3 (mod 11).

Fermats little theorem sometimes is beneficial for quickly discovering a solution to some exponentiations. The following examples show the concept.

Example1 − Find the result of 610 mod 11.


Here, we have 610 mod 11 = 1. This is the first version of Fermat’s little theorem where p = 11.

Example2 − Find the result of 312 mod 11.


Therefore the exponent (12) and the modulus (11) are not equal. With substitution this can be defined utilizing Fermat’s little theorem.

312 mod11 = (311x3)mod11 = (311mod11)(3 mod 11) = (3x3)mod11 = 9

Updated on 15-Mar-2022 11:45:24