Testing of randomness of binary bit sequences

37 Views Asked by At

I am trying to test randomness of binary bit sequence using NIST test suite. The tests applied for testing requires longer length of bit sequence. I have 256 bits sequence. Is it a good approach to arrange multiple 256 bit sequences together and treating them as single bit stream for testing? if not what could be the things at stack from randomness point of view.

1

There are 1 best solutions below

3
On

Do you have "Single" $256$ Bits Sequence ?
If YES , then concatenating that Sequence blindly will most likely not give good randomness.
If NO , then keep generating $N$ such $256$ Bits Sequences to get a larger Block of $256N$ Bits Sequence & use that.

In Either Case , you might get slightly better randomness if you tweak the given Input Sequence to generate a new Output Sequence. Example tweak :
(1) generate the first normal Bit Sequence
(2) treat it like $64$ Blocks , with $2$ Bits in each Block ($2 \times 64 = 256$)
(3) Consider each 2 Bits Block :
(3A) If it is $00$ , then generate the normal 256 Bit Sequence & put that to New Output Sequence.
(3B) If it is $01$ , then generate the normal 256 Bit Sequence & toggle the Bits ($0$ to $1$ & $1$ to $0$) & put that to New Output Sequence.
(3C) If it is $10$ , then generate the normal 256 Bit Sequence & reverse it (first Bit is last & last Bit is first) & put that to New Output Sequence.
(3D) If it is $11$ , then generate the normal 256 Bit Sequence & toggle the Bits & reverse the Bits & put that to New Output Sequence.
(4) You will Eventually get $256 \times 64 = 2^{14}$ Bits New Output Sequence.
(5) You can use that New Output Sequence ($64$ KBits) to the NIST test.