onbit-uchenik / shamir_secret_share

C++ implementation of Shamir Secret Scheme over GF(256)
Apache License 2.0
22 stars 8 forks source link

Generating Cryptography Strong Random numbers #2

Closed onbit-uchenik closed 4 years ago

onbit-uchenik commented 4 years ago

In file https://github.com/onbitSyn/shamir_secret_share/blob/master/src/shamir.cpp in function scheme::createShares(string secret), rand() function is used to generate random function, which we all know is not secured, so instead of that new algorithm is used for creating strong random numbers.

onbit-uchenik commented 4 years ago

the issue has been solved using the std::random_device to get a random seed which is then passed as a seed to the default_random_engine (psuedo random number generating algorithm). The following implementation is so chosen because of the article https://crypto.stackexchange.com/questions/10701/shamirs-secret-share-over-the-reals