Issue
Hi can somebody tell me which format /dev/urandom outputs and How i can replicate the output manually?.
I am trying to remove the idea of randomness from the script i am writing/using and instead place an incrementing value in order like 1,2,3,4,5 etc...
Yet /dev/urandom does not output integers, i do not know which format the output is. It looks like some kind of Hex/Binary
I think this is one way of using /dev/urandom
hexdump -C -n 8 /dev/random
However there maybe other ways. I am just trying to remove any randomness from my script and replace it with an incrementing value. So in order words instead of random values i want them all in order from the first possible in the /dev/urandom range to the last value in the /dev/urandom range.
Does anybody know how to do this?
-- update: Using this line was completely a wrong approach in my original question
hexdump -C -n 8 /dev/random
because /dev/urandom does actually output a integer normally not a binary/hex as i have now worked out.
Solution
Reading from /dev/urandom just gives you random bytes. The code you mentioned in the comments reads 32 random bytes from /dev/urandom into a buffer.
If you don't want random values but instead a set of sequential values, write (for example) the values 1 to 32 in the 32 bytes, i.e:
for (i=0;i<32;i++) {
seckey[i]=i+1;
}
Answered By - dbush