I
Ioannis Vranos
I want to create some random numbers for encryption purposes, and i wonder
if the following scheme makes it more hard to guess the underneath number
generation pattern, than the plain use of rand():
#include <stdlib.h>
#include <time.h>
int GetRandomNumber(void)
{
int depth=rand();
for(int i=0; i<depth; ++i)
rand();
return rand();
}
int main(void)
{
srand(time(0));
int y=GetRandomNumber();
}
Does the above make any difference over plain use of rand()?
Regards,
Ioannis Vranos
if the following scheme makes it more hard to guess the underneath number
generation pattern, than the plain use of rand():
#include <stdlib.h>
#include <time.h>
int GetRandomNumber(void)
{
int depth=rand();
for(int i=0; i<depth; ++i)
rand();
return rand();
}
int main(void)
{
srand(time(0));
int y=GetRandomNumber();
}
Does the above make any difference over plain use of rand()?
Regards,
Ioannis Vranos