0

$p,q,e$ and $m$ are known

$n=p \times q$

$c=m^e \mod n$

I want to get the $j$, when $c=c^{e^j}$

What am I doing wrong?

function j=iter(p,q,m,e)

n=p*q

j=1;

b=m^e

c=mod(b,n)

while c~=c^(e^j)

    j=j+1;

end
end
qwr
  • 10,716

1 Answers1

1

$$c = c^{e^j}$$

gives

$$e^j=1$$

so

$$j=0$$

So, as your program searches numbers greater than 1, it does not find the answer (which is always 0).

Lucas
  • 1,469
  • How can I solve it? I have no other idea. – user142176 May 03 '14 at 22:01
  • @user142176 The answer is always zero. So function j=iter(p,q,m,e); return 0; end. Also, your code would work if line 3 was j=0, but I think there might be a mistake somewhere in the specification of your problem. – Lucas May 03 '14 at 22:09