3
$\begingroup$

I am trying to implement DH using Python (for tests), and its working for

(3 ^ random_number) mod 17

In order to be secure, the prime (in this case, 17) needs to be very long.

My question is: Where can i find secure primes and primitive roots to make the algoritym secure? As long as i know, generating these numbers requires a lot of computational power and time, and do not increases the security significantly.

I also have seen some standart quations in order to get secure numbers, but i have no Idea how to implement them Python.

Thanks in advance.

$\endgroup$
4
  • 2
    $\begingroup$ This lists a bunch of more or less standard parameters. $\endgroup$
    – SEJPM
    Commented Oct 25, 2016 at 20:26
  • $\begingroup$ I already have seen this document, but i do not know how should i use these equations. Example: 2^3072 - 2^3008 - 1 + 2^64 * { [2^2942 pi] + 1690314 } -How can i implement this in Python? Why it does not simply gives the number? $\endgroup$ Commented Oct 25, 2016 at 21:42
  • $\begingroup$ You mean why doesn't it have something like "Its hexadecimal value is:", followed by the actual value? $\endgroup$
    – poncho
    Commented Oct 25, 2016 at 21:46
  • $\begingroup$ I have tried to decode to get the number, but all websites were not able to do it. Should i just place the equation there (with the correct operators) as the prime number and let it solve the equation? Thanks in advance! $\endgroup$ Commented Oct 25, 2016 at 21:52

1 Answer 1

-2
$\begingroup$

It worked fine with "5809605995369958062791915965639201402176612226902900533702900882779736177890990861472094774477339581147373410185646378328043729800750470098210924487866935059164371588168047540943981644516632755067501626434556398193186628990071248660819361205119793693985433297036118232914410171876807536457391277857011849897410207519105333355801121109356897459426271845471397952675959440793493071628394122780510124618488232602464649876850458861245784240929258426287699705312584509625419513463605155428017165714465363094021609290561084025893662561222573202082865797821865270991145082200656978177192827024538990239969175546190770645685893438011714430426409338676314743571154537142031573004276428701433036381801705308659830751190352946025482059931306571004727362479688415574702596946457770284148435989129632853918392117997472632693078113129886487399347796982772784615865232621289656944284216824611318709764535152507354116344703769998514148343807"

Thank you!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.