Board index » delphi » 'Very large Number' problem

'Very large Number' problem

I am trying to implement a Diffi-Hellman Key Exchange algorithm. The problem
that i'm having is that it requires rediculous large numbers and i can't
figure out how to use these in Delphi.

First of all, i have a constant 768 bit prime from rfc 2412 (e.g.
http://www.faqs.org/rfcs/rfc2412.html):

P :=
1552518092300708935130918131258481755631334049434514313202351194902966239949
1021072586694538765916424429100076802888642291508037189180463426327276130312
8298374438082089019628850917069131659317536746955176311984337163722100721057
7919

Then i generate a random private number, something  like:

pK :=  210230652384848325517647878360676959278437770489

Ok, i allready have problems trying to assing these numbers to variable, i
can't make it work. Given i _do_ succeed to assign them i have to do the
following operation:

2^pK mod P

Any help would be greatly appreciated. I have written a server in a language
called python where these operations are extremely easy. I'd very much like
to write a client for it in Delphi, but with this i can't even come passed
the authorization stage.

many thanks,

Gumuz

 

Re:'Very large Number' problem


Guyon

I don't know if this will help with your problem

    http://www.multimania.com/marat/delphi/python.htm
    http://groups.yahoo.com/group/pythonfordelphi

--
HTH
Steve

Other Threads