密码学 数论入门 Fermat Theorem 实战

版权声明:转载请附上文章地址 https://blog.csdn.net/weixin_38134491/article/details/84996257
  • 对两个连续整数n和n+1,为什么gcd(n,n+1)=1?

Because when n+1 is divided by n then remainder is 1. Therefore 1 is  the GCD of n, n+1

  • 利用费马定理计算3^201 mod 11

Fermat theorem explains a^p-1 =1 mod p, where p is a prime number and a is positive number that is not disvisible by p.

3^201 mod 11= (3^1 mod 11)* (3^200 mod 11) mod 11 =(3^1 mod 11) * (3^10 mod 11)^20 mod 11

By using Fermat's rule a^p-1 =1 mod p

= (3^1 mod 11) *(1 mod 11)^20 mod 11

=1* 3 mod 11

=3

  • 利用费马定理找一个0~72之间的数a,使得a模73与9^794同余

Fermat's theorem explain a^p-1 = 1 mod p

9^794 mod 73

=(9^720 mod 73) * (9^74 mod 73)  mod 73

扫描二维码关注公众号,回复: 4520083 查看本文章

=(9^72 mod 73)^10 * (9^74 mod 73) mod 73

By fermat's rule 9^72 mod 73=1 mod 73

=1* (9^74 mod 73) mod 73

=(9^72)mod 73 * 9^2 mod 73

=81mod 73

=8

  • 利用费马定理找一个位于0~28之间的数 x,使得 x^85 模29与6 同余

Fermat's theorem explains the following,

a^p-1 =1 mod p ,  p is a prime, a is a positive integer 

Another alternative form of Fermat's theorem is used in the problem.

a^p = a mod p, p is a prime, a is a positive

猜你喜欢

转载自blog.csdn.net/weixin_38134491/article/details/84996257