Dear all,
 
(1) i trying to generate RSA Key by utilizing AutoSeededRandomPool (as shown below).
---------------------------------------------------------------------------------------------
| AutoSeededRandomPool randPool;
| RSAES_OAEP_SHA_Decryptor priv(randPool, keyLength);
| HexEncoder privKey(new StringSink(secstring));
| ...etc
---------------------------------------------------------------------------------------------
However, my Solaris complains "AutoSeededRandomPool undeclared".
Q1: Is there any other method to generate an auto seeded random number (in Solaris) other than using AutoSeededRandomPool??
 
 
(2) as a result from (1), i try to modify the coding by using time(NULL) as the seed. (as show below)
----------------------------------------------------------------------------------------------
| Seed = time(0); //something like that
| ...
| RandomPool randPool;
| randPool.Put((byte *)Seed, strlen((char*)Seed));
| RSAES_OAEP_SHA_Decryptor priv(randPool, keyLength);
| HexEncoder privKey(new StringSink(secstring));
| etc..
----------------------------------------------------------------------------------------------
it's work. However, i discovered that, if two successive key generating happen very closed to each other (>1second), they will generated the SAME key pairs (i experience it before)! it is because the time(0) function returns the current computer time(calender) in seconds, hence, if the time is less than, say, a second, there will be no difference for the Seed of this two successive key generating. it my simulation, the time for two succesive key generating always less than a second.
Q2: Can anyone suggests a better method to generate an auto seeded random number if the succesive key generating happen so closed to each other??
 
really appreciate if someone can help me.
thanks in advance.
 
Regards,
 

Reply via email to