made reading /dev/urandom in encrypter little bit more variable

This commit is contained in:
Václav Šmejkal 2022-11-17 14:26:08 +01:00
parent 79617cb3b4
commit e70b54da69
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19

View File

@ -40,7 +40,7 @@ outputFlags encryptText(char *text, char *keyNew)
//TRY TO MAKE RANDOM GENERATION REALLY "RANDOM"
fileBuffer = fopen("/dev/urandom", "r");
fread(&numberBuffer, 4, 1, fileBuffer);
fread(&numberBuffer, sizeof(numberBuffer), 1, fileBuffer);
srand(numberBuffer);
numberBuffer = abs(numberBuffer); //MAKE numberBuffer POSITIVE