2

I created my random numbers and I saved them into a txt file. My input file includes just 0 and 1. Here is the link of my file

And I of course read some answer before asking that question but I could not understand how can I create an input file for diehard. Do diehard have some prepared comment for converting our input file for itself or we should do it by hand? If we should do it how? I see too many parameters like generator see type count numbit ... Could you please help me?


Update: I actually answered this question but I have some troubles related my account so the answer is just lost so I am writing again

  1. Many thanks for your answe rI think it finally worked with that enter image description here

  2. just to be sure: what is d? when I looked other example I sometimes saw b instead of d

  3. I have just 0 and 1 so numbit should be 1 I guess, right?

  4. and you wrote some numbers and they are actually random numbers right? (In my case it is jut 0 and 1 instead of 3129711816 85411969 2545911541)

  5. And I want to test how much my numbers are random with this file and this code script right?

  6. Also When I tried without changing my file as a header file, it worked with this code script: dieharder -a-f your-file.txt and what does thos script mean? OK it worked but I couldnt change my file like header file and I dont know what it means

Update-------------------------------------------------------------

Hello, I still have some troubles regarding matching of accounts so I am updating here

1)Happy Christtmas to you too!

I have not a bin file! Why do you think that. I am trying to produce quantum random numbes and my numbers will be either 1 or 0 and after producing them, I save it a txt file! WHat is the problem with txt file. I really dont understand your point. And studyong with diehard how many numbers should I have at least? 2000000 is not enough?? What are the other techniques

2)And can you please explain my questions, if you have seen them like what is d or is my header file correct?...

3)How can I convert my txt file as a binary file???

4)What is the other techniques for testing how much my numbers are random? Can NIST be ok?

5)For instance I used this line for converting bin file perl -ne 'print pack("B32", $_)' < instructions.txt > instructions.bin is that ok? And I used 10000000 data and I convert it as binary file and it was extremely fast. I think it should has been slow?

Important note: I am using dieharder 3.31.1 version

quest
  • 151
  • 1
  • 7

1 Answers1

2

Personally I never bother with ASCII and just go binary as it's easier, but so be it. There's a lot of good stuff on this page, but in essence what you need to do is...

One.

To use it with an ascii formatted file:
 dieharder -g 202 -f your-file.txt -a

(your-file.txt should consist of a header such as:

#==================================================================
# generator I did it myself
#==================================================================
type: d
count: 100000
numbit: 32
3129711816
  85411969
2545911541
etc...

Two.

Please read https://crypto.stackexchange.com/a/61546/23115. This is important. Dieharder is a glutton and craves loads and loads of data. 2,500,000 ASCII characters is way too low and the result will be absolutely meaningless other than just failing. The example in the linked answer sucked up 246 GB of binary bits so as not to rewind the data sample. That's more than a terabyte of ASCII.

Tip.

Randomness is a function of sample size. The size of your data set indicates alternative tests, such as the original diehard, or NIST's randomness test suite. The latter is pretty common in the literature for modern RNG designs, and I prefer it.


dieharder -a -g 201 -f your-file.bin to do it in binary without all that header nonsense.

Paul Uszak
  • 15,905
  • 2
  • 32
  • 83