mardi 5 septembre 2017

How `openssl genrsa` generates different keys with the same random seed?

According to the algorithm of RSA key generation, 2 distinct prime numbers will be randomly picked. And I found there an option -rand in genrsa:

-rand file(s)
  a file or files containing random data used to seed the random number
  generator, or an EGD socket (see RAND_egd(3)).  Multiple files can be
  specified separated by a OS-dependent character.  The separator is ;
  for MS-Windows, , for OpenVMS, and : for all others.

I assumed the generated keys would be the same if the same seed file was given, so I created a file seed with echo seed > seed and execute openssl genrsa -rand seed 2048 several times. However, the output was varied every time.

I wonder if it is possible to generate the same RSA key using openssl command with some specific command options.

I would appreciate your help.




Aucun commentaire:

Enregistrer un commentaire