Блог пользователя aajjbb

Автор aajjbb, 12 лет назад, По-английски

Hello,

I recently solved problem RSA. But one detail confused me. One of the needs of the problem is to find the modular inverse of one number A module MOD. I always computed this operation with Euler's theorem stated here Theorem. But in this problem, surprisingly, it doesn't work, and I had to compute this modular inverse though the Extended GCD algorithm. Is there any cases which Euler's theorem doesn't work ?

Euler's theorem Code (I've used this code in dozens of problems without trouble)

Extended GCD Code

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
12 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

m - 2 = φ(m) - 1 when m is prime and in this problem it is definitely composite.

»
12 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Euler's theorem works fine for prime numbers, but afaik Mod in rsa encrypting is not a prime one.