On Sunday, February 15, 2015 at 8:03:06 PM UTC-5, Jeffrey Walton wrote:
On Sunday, February 15, 2015 at 7:13:42 AM UTC-5, Aydin Abadi wrote:
I need to know how I can store (or access) the seed generated by a pseudorandom generator in crypto++. So i need to access the random seed to re-use it for some purpose.
A RandomPool is the wrong tool here because it also uses time in its calculations. Sorry about that - I should have checked before I made the recommendation.
You can use OFB_Mode<T>::Encryption because it indirectly inherits from RandomNumberGenerator by way of AdditiveCipherTemplate<T>. For T (the T for OFB mode), use something like 3-key TripleDES, Camellia or AES. Crypto++'s test.cpp actually uses the AES/OFB generator (its the thing returned from GlobalPRNG()). Note: other modes of operation do *not* inherit from RandomNumberGenerator, so you can't use them in this instance.