unfucked generating random seed
This commit is contained in:
parent
799fc752b2
commit
80dd838ca8
@ -59,8 +59,8 @@ outputFlags encryptText(char *text, char *keyNew)
|
|||||||
//TRY TO MAKE RANDOM GENERATION REALLY "RANDOM"
|
//TRY TO MAKE RANDOM GENERATION REALLY "RANDOM"
|
||||||
fileBuffer = fopen("/dev/urandom", "r");
|
fileBuffer = fopen("/dev/urandom", "r");
|
||||||
(void) (fread(&numberBuffer, sizeof(numberBuffer), 1, fileBuffer) + 1); //TODO: Try to create some function for processing exit value
|
(void) (fread(&numberBuffer, sizeof(numberBuffer), 1, fileBuffer) + 1); //TODO: Try to create some function for processing exit value
|
||||||
srand(numberBuffer);
|
|
||||||
numberBuffer = abs(numberBuffer); //MAKE numberBuffer POSITIVE
|
numberBuffer = abs(numberBuffer); //MAKE numberBuffer POSITIVE
|
||||||
|
srand(numberBuffer);
|
||||||
|
|
||||||
if (keyNew != NULL)
|
if (keyNew != NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user