Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/dev/random is slow
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
kubrick2001
n00b
n00b


Joined: 24 Nov 2004
Posts: 56

PostPosted: Mon Jan 03, 2005 7:36 am    Post subject: /dev/random is slow Reply with quote

I was playing with an encrypted diskpartition and I had the idea to put random data on my disk.

Then I tried
dd if=/dev/random of=/dev/hda6

After 24h I killed this command because it was still running.

Then I
cat /dev/random|strings

and saw that there were only a few characters flowing whenever I moved the mousepointer. Is this normal and is there something to accelerate this ?
Back to top
View user's profile Send private message
Irom
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2003
Posts: 93
Location: am arsch..

PostPosted: Mon Jan 03, 2005 8:06 am    Post subject: Reply with quote

Yes, move the pointer faster ;)

It is normal. You can speed it up by using your computer (playing sound, moving the mouse, accessing the disk, ..) because Linux uses these random events to spit out good random numbers. If this isn't important you can use /dev/urandom, which is fast.
_________________
http://ftp.fukt.bsnet.se/pub/movies/stallman/ (Please watch this before you form an opinion about GNU)
https://apfelboymchen.net/gnu/
Back to top
View user's profile Send private message
kubrick2001
n00b
n00b


Joined: 24 Nov 2004
Posts: 56

PostPosted: Mon Jan 03, 2005 5:19 pm    Post subject: Reply with quote

Thanks for the tip.
/dev/urandom is much faster. :D
Back to top
View user's profile Send private message
iTux
Guru
Guru


Joined: 07 Sep 2004
Posts: 586
Location: Toronto

PostPosted: Wed Jan 05, 2005 7:48 pm    Post subject: Reply with quote

Hi,

I played with /dev/random recently to generate random numbers. The kernel does not keep much bytes buffered maybe ~512 or less.

I'm not sure how strong is /dev/urandom, cryptographically speaking, but it should be sufficient for the disk if you want to simply randomize it (for example to make it harder for someone to guess the portion used by encrypted data).

Someone worried about previous not encrypted data on partition should probably use shred first to make it very very difficult to recover in laboratory. Then /dev/urandom to randomize content.

iTux
Back to top
View user's profile Send private message
nakan
n00b
n00b


Joined: 06 Jan 2005
Posts: 40
Location: Cugy - Vaud - Switzerland

PostPosted: Thu Jan 06, 2005 8:24 pm    Post subject: Reply with quote

Irom wrote:
Yes, move the pointer faster ;)

It is normal. You can speed it up by using your computer (playing sound, moving the mouse, accessing the disk, ..) because Linux uses these random events to spit out good random numbers. If this isn't important you can use /dev/urandom, which is fast.


So, you can use:
# cat /dev/random > /dev/null &
# dd if=/dev/random of=/dev/hda6

:-)
_________________
- iBook G4 12" 1.2Ghz 512Mb 60Go / Gentoo
- Custom PC P4 2.6 HT 1024Mb / RAID 160Go SATA / Gentoo
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum