Re: a^(b^x) mod n?




<fredsaf_20055@xxxxxxxxx> wrote in message
news:1119442304.187215.127240@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Given positive integers a,b,x,n is it possible to efficiently compute:
>
> a^(b^x) mod n?
>
> phi(n) is unknown and b^x is so large it can't be used directly.
>
> Or is it known this to be a hard problem?
>
> Thanks.
>
> --
> Fred
>

It can be done efficiently with a computer. You use the fact that

a^(b^x) = ( a^(b^(x-1) ) )^x

And work in reverse, i.e. start with a^b mod n and keep raising to the b'th
power, see further. Denoting

a_1 = a^b mod n,

then

a_2 = a_1^b mod n = a^(b^2)

a_3 = a_2^b mod n = a^(b^3)

and repeat x times to obtain

a_x = a_x-1^b mod n = a^(b^x).

E.g. if x is 1000, then repeat 1000 times.

To raise a^b you use the binary method in the previous respondents reply.

RJM



.



Relevant Pages

  • Re: a^(b^x) mod n?
    ... > Given positive integers a,b,x,n is it possible to efficiently compute: ... > phiis unknown and b^x is so large it can't be used directly. ... Only need roughly O) multiplications. ...
    (sci.math)
  • Re: a^(b^x) mod n?
    ... > Given positive integers a,b,x,n is it possible to efficiently compute: ... > phiis unknown and b^x is so large it can't be used directly. ... You can compute the value b^x and then use the square and multiply ... algorithm. ...
    (sci.crypt)
  • Re: a^(b^x) mod n?
    ... >Given positive integers a,b,x,n is it possible to efficiently compute: ... >phiis unknown and b^x is so large it can't be used directly. ... >Or is it known this to be a hard problem? ... "I can't seem to find any efficient algorithm for this problem"). ...
    (sci.crypt)
  • Re: 2.6.19-rc5: known regressions
    ... Submitter: Alex Romosan ... Status: unknown ... If so I'd like you to repeat with this ...
    (Linux-Kernel)
  • Re: Sen. Clintons campaign failed due to...
    ... Is this where you start to repeat yourself ten times over? ... Never ride faster than your guardian angel can fly ... ~Author Unknown ...
    (misc.news.internet.discuss)