Skip to main content
MMart.9
Associate
August 12, 2019
Solved

How do you generate public and private keys for RSA?

  • August 12, 2019
  • 1 reply
  • 1729 views

The user manual (UM1924) says in section 15 RSA Algorithm:

There are two structures that pass keys to the functions:

•RSAprivKey_stt for the private key

•RSApubKey_stt for the public key

All members of the above functions should be filled by the user before calls to the RSA functions.

So I need the keys before using the library.

In the STM32_Cryptographic_example, in the RSA subfolder there's an example code that already comes with a pre-generated array for modulus, public and private exponents, message and signature, but how do you generate those arrays?

How do you generate the keys?

I know that modulus n=p*q and private exponent d=(e^-1)mod(Phi)... and all that, but I would think those formulas come already in the libraries and if not, how should one generate large p's and q's then?

This topic has been closed for replies.
Best answer by After Forever

You can use standard command line tools like openssl or use some kind of graphical tool like RSATool

1 reply

After Forever
After ForeverBest answer
Senior III
August 14, 2019

You can use standard command line tools like openssl or use some kind of graphical tool like RSATool

MMart.9
MMart.9Author
Associate
August 14, 2019

Thank you!