[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openssl-dev
Subject:    [openssl-dev] RAND_bytes() Properly Reseeding
From:       "Schmicker, Robert" <rschm2 () unh ! newhaven ! edu>
Date:       2016-09-29 18:13:31
Message-ID: 56662209-C1B1-4437-ABBC-4382E6C00A92 () unh ! newhaven ! edu
[Download RAW message or body]

Hello,

I'm a little unsure on the recommended way to properly reseed the RAND_bytes() \
function. My output provides random numbers, but only the first 16 bytes. The output \
of byte 16 and on is just some period of the first 16 bytes and therefore has several \
duplicated numbers.

My inputs are four seeds, each 128 bits in size. A SEED_SIZE with a value of 16 \
(where I believe the periodicity to be coming from). 

Then an output buffer of 256 bits containing the random bytes as well as the \
RAND_SIZE with a value of 64.


1: RAND_seed(s->seed1, SEED_SIZE);
2: RAND_bytes(buffer1, RAND_SIZE);

3: RAND_seed(s->seed2, SEED_SIZE);
4: RAND_bytes(buffer2, RAND_SIZE);

5: RAND_seed(s->seed3, SEED_SIZE);
6: RAND_bytes(buffer3, RAND_SIZE);

7: RAND_seed(s->seed4, SEED_SIZE);
8: RAND_bytes(buffer4, RAND_SIZE);

Any reason why four very different seeds are providing the same random numbers, but \
just in different orders?

Thank you for the read and any help,
Rob Schmicker
-- 
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic