Hi,
I'm trying to figure out how to implement RSA crypto from scratch (just for the intellectual exercise), and i'm stuck on this point:
For encryption, c = me mod n
Now, e is normally 65537. m and n are 1024-bit integers (eg 128-byte arrays). This is obviously too big for standard methods. How would you implement this?
I've been reading a bit about exponentiation here but it just isn't clicking for me:
http://en.wikipedia.org/wiki/Exponentiation_by_squaring
http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf (see section 14.85)
Thanks.
edit: Also found this - is this more what i should be looking at? http://en.wikipedia.org/wiki/Modular_exponentiation