-1

I want to make a DH Key exchange with a PC and an Arduino. I want to generate a Prime p and a Base g on the Arduino that should be 2048 Bits long.

  • Welcome to SO. You shoud give some example, what have you tried yet and what is your specific problem. – Andy A. May 21 '21 at 10:21
  • I tried to use the crypto library for Arduino, but when I took both outputs I got different keys, so I want to do my own key exchange. It should talk from the Arduino to a chrome extention over a python bridge(I already did the python bridge) – derGraph May 21 '21 at 19:31

1 Answers1

0

You don't generate p and g.

They are specified by the Diffie-Hellman group choice.

You only need to generate a random integer in the range of zero to the group mod-1.

Woodstock
  • 22,184
  • 15
  • 80
  • 118