Calculating very large exponents in python

Posted by miraclesoul on Stack Overflow See other posts from Stack Overflow or by miraclesoul
Published on 2010-03-06T11:02:52Z Indexed on 2010/03/08 13:06 UTC
Read the original article Hit count: 98

Filed under:

Dear All, Currently i am simulating my cryptographic scheme to test it. I have developed the code but i am stuck at one point.

I am trying to take : g**x where g = 256 bit number x = 256 bit number

Python hangs at this point, i have read alot of forums, threads etcc but only come to the conclusion that python hangs, as its hard for it to process such large numbers.

any idea how can it be done? any two line piece of code, any library, anything that can be done.(ALSO PLEASE I AM A NEW PYTHON USER AND THIS IS FIRST TIME I DID PROGRAMMING IN IT, SO NO COMPLEX METHODS ...HOPE YOU UNDERSTAND :s)

© Stack Overflow or respective owner

Related posts about python