LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-27-2011, 05:32 PM   #16
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Wink


Just to follow up - I have been runnning some tests using cepheus11's tip. The results are dramatically different. These were ran on a 2GB drive in VirtualBox.
Code:
cryptsetup -c aes-cbc-essiv:sha256 -s 256 -d /dev/urandom create shredder /dev/sdb
time dd if=/dev/zero bs=1M of=/dev/mapper/shredder
   real    1m40.968s
   user    0m0.008s
   sys     0m12.423s
cryptsetup remove shredder

time dd if=/dev/urandom of=/dev/sdb
   real    14m44.269s
   user    0m2.207s
   sys     10m55.680s
Although these tests where ran in a VM,(so a real disk may be quicker in both tests), that's still a difference of over over a factor of 10! Worth thinking about for anyone wishing to securely encrypt a large disk. If these timings extrapolate linearly that means 200GB volume would take about 24 hours by the traditional method and about 2.5 hours by the new - quite amazing.
 
Old 02-28-2011, 05:27 AM   #17
cepheus11
Member
 
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 286

Rep: Reputation: 91
Yes, encryption algorithms like AES are fast enough to not be the bottleneck. Disc IO is the cryptsetup-method's bottleneck, so you can expect around 30 MB / s. But if someone finds a weakness in AES in the future, it might be possible to tell that this is not (pseudo)random, but just encrypted zero's with a throw-away key.

For a test like you did, you should use the same blocksize for dd in both methods, i.e. 1 MB:

Code:
dd if=... bs=1M ...
Your second test could have been additionally slower because dd wrote 1-Byte chunks.
 
1 members found this post helpful.
Old 02-28-2011, 06:19 AM   #18
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Quote:
For a test like you did, you should use the same blocksize for dd in both methods, i.e. 1 MB:
Yes I can see that to be truly fair that should be done - should've spotted that. I quoted that second test verbatim as this is the way it's usually given in texts on encrypting partitions, I can see how this would speed it up a little.

Anyway, here's the second test with the adjusted byte count set to 1M so they are both operating the same :
Code:
time dd if=/dev/urandom bs=1M of=/dev/sdb
real 11m48.365
user 0m0.016s
sys 11m31.324s
Not quite as bad as before but almost. Still a wonderful trick to know about if you are ever encrypting partitions - crypsetup has a lot of options I have never used and I'll be studying it more closely now.
 
  


Reply

Tags
check, or dev or urandom, proccess, status



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dd if=/dev/urandom of=/dev/hda2 bs=1M doesn't work Melsync Linux - General 16 05-19-2014 06:36 PM
[SOLVED] Stupidly ran "cat /dev/urandom > /dev/mem", worried I broke firmware crosstalk Linux - Hardware 2 10-25-2010 05:27 PM
SFTP script, status of the proccess solar05 Programming 2 07-08-2009 08:23 PM
[SOLVED] wiping HDD using /dev/urandom versus /dev/zero, a theoretical question H_TeXMeX_H Linux - General 6 06-29-2009 06:55 AM
/dev/random and /dev/urandom pool(s)? kpeirce Linux - Software 2 01-31-2006 06:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration