Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion on random data generation #1

Closed
awai54st opened this issue Nov 1, 2016 · 1 comment
Closed

Suggestion on random data generation #1

awai54st opened this issue Nov 1, 2016 · 1 comment

Comments

@awai54st
Copy link

awai54st commented Nov 1, 2016

Hi,

At the end of section "Exploring the application", when generating 1024 bytes of random data, the command below is used.

cat /dev/random | head -c 1024 > w/random1024.bin

While I was trying this with Ubuntu 16.04 terminal, the command could not stop normally. I found this link http://askubuntu.com/questions/192203/how-to-use-dev-urandom which suggests the following command instead.

head -c 1024 /dev/urandom > w/random1024.bin

This works for my machine. I tried the following command which also works for me.

cat /dev/urandom | head -c 1024 > w/random1024.bin

So maybe /dev/urandom works more reliably than /dev/random on UNIX-like machines?

@m8pple
Copy link
Contributor

m8pple commented Nov 1, 2016

Ah, good point - yes, you're completely right, /dev/random and /dev/urandom
can behave differently, and /dev/urandom makes sense here as we don't
need guaranteed entropy (we don't even really need cryptographic quality).

I'll update the command as suggested.

Thanks!

@m8pple m8pple closed this as completed in e7ef87c Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants