5,337
edits
(→/dev/) |
|||
Line 560: | Line 560: | ||
==<code>/dev/</code>== | ==<code>/dev/</code>== | ||
See [[Wikipedia: Device file#Pseudo-devices]] | |||
===<code>null</code>=== | |||
Discards all input. | |||
Produces EOF. | |||
===<code>random</code>=== | ===<code>random</code>=== | ||
See [https://security.stackexchange.com/questions/3936/is-a-rand-from-dev-urandom-secure-for-a-login-key/3939#3939 stackexchange]<br> | See [https://security.stackexchange.com/questions/3936/is-a-rand-from-dev-urandom-secure-for-a-login-key/3939#3939 stackexchange]<br> | ||
Line 565: | Line 571: | ||
;TLDR: Use <code>/dev/urandom</code> instead of <code>/dev/random</code> | ;TLDR: Use <code>/dev/urandom</code> instead of <code>/dev/random</code> | ||
===<code>urandom</code>=== | |||
Produces random numbers. | |||
On my system, it's limited to about 50 MB/s. If you need faster, you can encrypt from <code>/dev/zero</code> to get 1 GB/s. | |||
See [https://serverfault.com/questions/6440/is-there-an-alternative-to-dev-urandom/415962#415962 reference]. | |||
<pre> | |||
# Using urandom | |||
dd if=/dev/urandom | pv | dd of=/dev/null | |||
# Using encryption | |||
openssl enc -aes-256-ctr -pass pass:"$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64)" -nosalt < /dev/zero | pv | dd of=/dev/null | |||
</pre> | |||
==Gnome== | ==Gnome== |