![](https://seccdn.libravatar.org/avatar/32cc7bfc74b244369be6e0c21ddb44e7.jpg?s=120&d=mm&r=g)
On Sunday 20 of April 2014 16:45:28 Carlos E. R. wrote:
Hi,
I'm using this piece of code :
dd iflag=fullblock if=/dev/random of=keyfile bs=512 count=8
to generate random file to be used as key for an encritped filesystem. However, the block does not appear to be fully random, because I recognize text patterns inside:
000000b0 af 60 31 79 02 9f f9 92 ad e5 a3 62 f2 72 39 f7 |.`1y.......b.r9.| 000000c0 3b 5c 9a 27 4e 30 54 be 34 32 02 ea 23 82 96 f3 |;\.'N0T.42..#...| 000000d0 88 5d 8d 3d 7e fe 16 d6 53 91 18 de b1 49 a8 21 |.].=~...S....I.!|
See the "'N0T.42" there. Am I doing it wrong, or simply overreacting?
This is the output of stan with your data as input: General statistics for the stream, bytes 48 Arithmetic mean: 123.583333 ~ 0x7b({) Median: 121.000000 ~ 0x79(y) Deviation: 73.069269 ~ 0x49(I) Chi-Square test: 178.472059 Entropy per byte: 5.543296 Correlation co.: -0.228702 Pattern length 1, different 47, total 48, bytes 48, depth 9 - Pattern range 0x02( ): 0x00000002 - 0xfe( ): 0x00000001 - 10 most used patterns 0x02( ): 0x00000002 0xaf( ): 0x00000001 0x60(`): 0x00000001 0x31(1): 0x00000001 0x27('): 0x00000001 0x23(#): 0x00000001 0x16( ): 0x00000001 0x18( ): 0x00000001 0x21(!): 0x00000001 0x30(0): 0x00000001 Pattern length 2, different 47, total 47, bytes 48, depth 8 - Pattern range 0x029f( ): 0x00000001 - 0xfe16( ): 0x00000001 - 10 most used patterns 0xaf60( `): 0x00000001 0x6031(`1): 0x00000001 0x3179(1y): 0x00000001 0x029f( ): 0x00000001 0x274e('N): 0x00000001 0x02ea( ): 0x00000001 0x2382(# ): 0x00000001 0x16d6( ): 0x00000001 0x18de( ): 0x00000001 0x3054(0T): 0x00000001 Entropy per byte seems high enough, so it is random data for most purposes. If you suspect that your computer generates low amount of entropy, try haveged. -- Regards, Peter -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org