blaine <[EMAIL PROTECTED]> writes:
> As an alternative I
> can use Java - but I'd rather have a pure python implementation.
A number of people have suggested using 3-argument pow, but if this is
supposed to be a learning exercise, I think it's worth figuring out
for yourself how 3-argument pow is
blaine <[EMAIL PROTECTED]> wrote:
>
> For my Network Security class we are designing a project that will,
>among other things, implement a Diffie Hellman secret key exchange.
>The rest of the class is doing Java, while myself and a classmate are
>using Python (as proof of concept). I am having pr
For the interested, the algorithm that is most likely being used is
http://en.wikipedia.org/wiki/Exponentiation_by_squaring
If you scroll down, there is a ruby implementation. Combine this with
a little bit of http://en.wikipedia.org/wiki/Modular_arithmetic and I
wrote a small python function that
blaine <[EMAIL PROTECTED]> writes:
> Python Code:
> G =
> long(2333938645766150615511255943169694097469294538730577330470365230748185729160097289200390738424346682521059501689463393405180773510126708477896062227281603)
> P =
> long(7897383601534681724700886135766287333879367007236994792380
On Nov 19, 10:32 am, blaine <[EMAIL PROTECTED]> wrote:
> Hey guys,
> For my Network Security class we are designing a project that will,
> among other things, implement a Diffie Hellman secret key exchange.
> The rest of the class is doing Java, while myself and a classmate are
> using Python (as
blaine wrote:
> Hey guys,
> For my Network Security class we are designing a project that will,
> among other things, implement a Diffie Hellman secret key exchange.
> The rest of the class is doing Java, while myself and a classmate are
> using Python (as proof of concept). I am having problems
blaine wrote:
> A = (G ** a) % P # G^a mod P
>
> ## END #
> The above code takes a very long time. If I make little a only 16 bits
> instead of 512, it takes about 12 seconds on my machine to compute. Is
> this incorrect usage of **? I used math.pow and built-in pow. The
> math.pow
On Nov 19, 2007 10:32 AM, blaine <[EMAIL PROTECTED]> wrote:
> Hey guys,
> For my Network Security class we are designing a project that will,
> among other things, implement a Diffie Hellman secret key exchange.
> The rest of the class is doing Java, while myself and a classmate are
> using Pytho
blaine <[EMAIL PROTECTED]> writes:
> A = (G ** a) % P # G^a mod P
Think of how large the intermediate result G**a will be. That should
explain why it's taking so long. So figure out what Java's modPow
function must be doing, and write something similar. Or, see the
docs for python's built-i
Hey guys,
For my Network Security class we are designing a project that will,
among other things, implement a Diffie Hellman secret key exchange.
The rest of the class is doing Java, while myself and a classmate are
using Python (as proof of concept). I am having problems though with
crunching h
10 matches
Mail list logo