1. 程式人生 > >密碼學 數論入門 Euler Theorem 實戰

密碼學 數論入門 Euler Theorem 實戰

  • 利用尤拉定理找一個0~9之間的數a,使得7^1000模10與a同餘(注意這等於7^1000的十進位制展開的最後一位)

Euler' sTheorem:

for every (a,n) that are relatively prime to Ø(n) is a conginent model.

a ^Ø(n) =1 mod n

This condition, a is between 0 to 9 that is conginent model to 7^1000 mod 10

such that 7 Ø(0~9) =1 mod 10

=7^1000 mod 10

=7^5 * 7^200 mod 10

=(7^5 mod 10)^200

=1

Therefore , a=1

 

  • 利用尤拉定理,找一個位0~28之間的整數x,使得x^85 模35與6同餘