hohl / MIHCrypto

OpenSSL wrapper for Objective-C [cryptography]
MIT License
340 stars 68 forks source link

RSA key generation seed? #49

Closed omerlh closed 7 years ago

omerlh commented 7 years ago

Hey, After a quick google search, I find this SO. So I looked in the manual and seems like the guy is correct and OpenSSL should be seeded before generating keys. My question is - did I understand it correctly? Becuase I looked up and it seems there is no call to RAND_add in this library... Thanks, Omer

hohl commented 7 years ago

No need to do that, libCrypto seeds itself in RAND_poll. See this SO question and the OpenSSL wiki for further reading on this topic.

However, for safety purposes, this library checks RAND_status to see if seed is prepared before doing anything, so you should be safe. See MIHInternal.h for more details on the safety check.

omerlh commented 7 years ago

ok, thank you!