* [dm-crypt] Filling a disk with random data - question
@ 2014-03-17 18:55 Cpp
2014-03-17 23:17 ` .. ink ..
2014-03-18 2:33 ` Arno Wagner
0 siblings, 2 replies; 8+ messages in thread
From: Cpp @ 2014-03-17 18:55 UTC (permalink / raw)
To: dm-crypt
Hello,
I noticed a lot of online articles recommend to overwrite your hard
disk with random data before creating an encryption volume on it.
Normally this is done by:
# dd if=/dev/urandom of=/dev/sda bs=4096
This will of course take a while, and there is also the badblocks
alternative. However recently I've seen another approach that uses an
encrypted (non-luks) container that is later filled with blank data.
It's said that this approach is much faster than the urandom method
above. I haven't used this yet, so I hope I got the command line
right:
# cryptsetup -c aes-xts-plain64 -h sha512 -s 512 -d /dev/urandom open
/dev/sda --type plain cryptroot
# dd if=/dev/zero of=/dev/mapper/cryptroot bs=4096
My question is are there any serious drawbacks of using this method in
place of the urandom one?
Best regards!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] Filling a disk with random data - question
2014-03-17 18:55 [dm-crypt] Filling a disk with random data - question Cpp
@ 2014-03-17 23:17 ` .. ink ..
2014-03-18 2:33 ` Arno Wagner
1 sibling, 0 replies; 8+ messages in thread
From: .. ink .. @ 2014-03-17 23:17 UTC (permalink / raw)
To: Cpp; +Cc: dm-crypt@saout.de
[-- Attachment #1: Type: text/plain, Size: 366 bytes --]
On Mon, Mar 17, 2014 at 2:55 PM, Cpp <tzornik@gmail.com> wrote:
> My question is are there any serious drawbacks of using this method in
> place of the urandom one?
>
>
I do not know of any drawbacks and i also use cryptsetup to fill up hard
drives with
random data or when creating encrypted container files because i too find
it to be faster
than /dev/urandom.
[-- Attachment #2: Type: text/html, Size: 843 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] Filling a disk with random data - question
2014-03-17 18:55 [dm-crypt] Filling a disk with random data - question Cpp
2014-03-17 23:17 ` .. ink ..
@ 2014-03-18 2:33 ` Arno Wagner
2014-03-18 22:20 ` Robert Nichols
2014-04-10 15:15 ` [dm-crypt] Filling a disk with random data - question Arno Wagner
1 sibling, 2 replies; 8+ messages in thread
From: Arno Wagner @ 2014-03-18 2:33 UTC (permalink / raw)
To: dm-crypt
On Mon, Mar 17, 2014 at 19:55:05 CET, Cpp wrote:
> Hello,
>
> I noticed a lot of online articles recommend to overwrite your hard
> disk with random data before creating an encryption volume on it.
> Normally this is done by:
>
> # dd if=/dev/urandom of=/dev/sda bs=4096
This is slooooooooooow.... ;-)
> This will of course take a while, and there is also the badblocks
> alternative. However recently I've seen another approach that uses an
> encrypted (non-luks) container that is later filled with blank data.
> It's said that this approach is much faster than the urandom method
> above.
I came up with that when I had to securely wipe 50 disks
a few years ago. Other people may have had a similar idea.
> I haven't used this yet, so I hope I got the command line
> right:
>
> # cryptsetup -c aes-xts-plain64 -h sha512 -s 512 -d /dev/urandom open
> /dev/sda --type plain cryptroot
Make ist easier on you, the defaults are really quite enough:
# cryptsetup create -d /dev/urandom /dev/sda cryptroot
> # dd if=/dev/zero of=/dev/mapper/cryptroot bs=4096
And you can get a progress meter like this:
# dd_rescue -w /dev/zero /dev/mapper/cryptroot
or like this
# cat /dev/zero | wcs > /dev/mapper/cryptroot
(uses my sream-meter "wcs" from: http://www.tansi.org/tools/index.html)
> My question is are there any serious drawbacks of using this method in
> place of the urandom one?
None.
Arno
--
Arno Wagner, Dr. sc. techn., Dipl. Inform., Email: arno@wagner.name
GnuPG: ID: CB5D9718 FP: 12D6 C03B 1B30 33BB 13CF B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. - Plato
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] Filling a disk with random data - question
2014-03-18 2:33 ` Arno Wagner
@ 2014-03-18 22:20 ` Robert Nichols
2014-03-18 23:41 ` [dm-crypt] Filling a disk with random data - use a hige bs= to speed it up Chris Drake
2014-04-10 15:15 ` [dm-crypt] Filling a disk with random data - question Arno Wagner
1 sibling, 1 reply; 8+ messages in thread
From: Robert Nichols @ 2014-03-18 22:20 UTC (permalink / raw)
To: dm-crypt
On 03/17/2014 09:33 PM, Arno Wagner wrote:
> On Mon, Mar 17, 2014 at 19:55:05 CET, Cpp wrote:
>> # cryptsetup -c aes-xts-plain64 -h sha512 -s 512 -d /dev/urandom open
>> /dev/sda --type plain cryptroot
>
> Make ist easier on you, the defaults are really quite enough:
>
> # cryptsetup create -d /dev/urandom /dev/sda cryptroot
>
>> # dd if=/dev/zero of=/dev/mapper/cryptroot bs=4096
>
>> My question is are there any serious drawbacks of using this method in
>> place of the urandom one?
>
> None.
Glad to hear it, since I've been doing that all along. If you happen
to be doing this with an old cryptsetup, you want to select an IV
that does not repeat on a large volume. This, for example would be
a poor choice (from cryptsetup 1.1.3):
Default compiled-in device cipher parameters:
plain: aes-cbc-plain, Key: 256 bits, Password hashing: ripemd160
--
Bob Nichols "NOSPAM" is really part of my email address.
Do NOT delete it.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] Filling a disk with random data - use a hige bs= to speed it up
2014-03-18 22:20 ` Robert Nichols
@ 2014-03-18 23:41 ` Chris Drake
0 siblings, 0 replies; 8+ messages in thread
From: Chris Drake @ 2014-03-18 23:41 UTC (permalink / raw)
To: dm-crypt
Hi Robert,
Remember to use a sensible bs= parameter on "dd" - maybe bs=8225280
instead of bs=4096 - writing one-block-at-a-time (bs=4096) would take
*days* (weeks even!) to fill a modern large drive!
Kind Regards,
Chris Drake
p.s. 8225280 is one whole track on older drives.
Wednesday, March 19, 2014, 8:20:47 AM, you wrote:
RN> On 03/17/2014 09:33 PM, Arno Wagner wrote:
>> On Mon, Mar 17, 2014 at 19:55:05 CET, Cpp wrote:
>>> # cryptsetup -c aes-xts-plain64 -h sha512 -s 512 -d /dev/urandom open
>>> /dev/sda --type plain cryptroot
>>
>> Make ist easier on you, the defaults are really quite enough:
>>
>> # cryptsetup create -d /dev/urandom /dev/sda cryptroot
>>
>>> # dd if=/dev/zero of=/dev/mapper/cryptroot bs=4096
>>
>>> My question is are there any serious drawbacks of using this method in
>>> place of the urandom one?
>>
>> None.
RN> Glad to hear it, since I've been doing that all along. If you happen
RN> to be doing this with an old cryptsetup, you want to select an IV
RN> that does not repeat on a large volume. This, for example would be
RN> a poor choice (from cryptsetup 1.1.3):
RN> Default compiled-in device cipher parameters:
RN> plain: aes-cbc-plain, Key: 256 bits, Password hashing: ripemd160
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] Filling a disk with random data - question
2014-03-18 2:33 ` Arno Wagner
2014-03-18 22:20 ` Robert Nichols
@ 2014-04-10 15:15 ` Arno Wagner
2014-04-10 15:50 ` .. ink ..
1 sibling, 1 reply; 8+ messages in thread
From: Arno Wagner @ 2014-04-10 15:15 UTC (permalink / raw)
To: dm-crypt
Just added this to the Wiki-Version of the FAQ as Item 2.19, if
anybody wants to have a look and comment.
Arno
On Tue, Mar 18, 2014 at 03:33:51 CET, Arno Wagner wrote:
> On Mon, Mar 17, 2014 at 19:55:05 CET, Cpp wrote:
> > Hello,
> >
> > I noticed a lot of online articles recommend to overwrite your hard
> > disk with random data before creating an encryption volume on it.
> > Normally this is done by:
> >
> > # dd if=/dev/urandom of=/dev/sda bs=4096
>
> This is slooooooooooow.... ;-)
>
> > This will of course take a while, and there is also the badblocks
> > alternative. However recently I've seen another approach that uses an
> > encrypted (non-luks) container that is later filled with blank data.
> > It's said that this approach is much faster than the urandom method
> > above.
>
> I came up with that when I had to securely wipe 50 disks
> a few years ago. Other people may have had a similar idea.
>
> > I haven't used this yet, so I hope I got the command line
> > right:
> >
> > # cryptsetup -c aes-xts-plain64 -h sha512 -s 512 -d /dev/urandom open
> > /dev/sda --type plain cryptroot
>
> Make ist easier on you, the defaults are really quite enough:
>
> # cryptsetup create -d /dev/urandom /dev/sda cryptroot
>
> > # dd if=/dev/zero of=/dev/mapper/cryptroot bs=4096
>
> And you can get a progress meter like this:
>
> # dd_rescue -w /dev/zero /dev/mapper/cryptroot
>
> or like this
>
> # cat /dev/zero | wcs > /dev/mapper/cryptroot
>
> (uses my sream-meter "wcs" from: http://www.tansi.org/tools/index.html)
>
> > My question is are there any serious drawbacks of using this method in
> > place of the urandom one?
>
> None.
>
> Arno
> --
> Arno Wagner, Dr. sc. techn., Dipl. Inform., Email: arno@wagner.name
> GnuPG: ID: CB5D9718 FP: 12D6 C03B 1B30 33BB 13CF B774 E35C 5FA1 CB5D 9718
> ----
> A good decision is based on knowledge and not on numbers. - Plato
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
--
Arno Wagner, Dr. sc. techn., Dipl. Inform., Email: arno@wagner.name
GnuPG: ID: CB5D9718 FP: 12D6 C03B 1B30 33BB 13CF B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. - Plato
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] Filling a disk with random data - question
2014-04-10 15:15 ` [dm-crypt] Filling a disk with random data - question Arno Wagner
@ 2014-04-10 15:50 ` .. ink ..
2014-04-10 16:09 ` Arno Wagner
0 siblings, 1 reply; 8+ messages in thread
From: .. ink .. @ 2014-04-10 15:50 UTC (permalink / raw)
To: dm-crypt@saout.de
[-- Attachment #1: Type: text/plain, Size: 574 bytes --]
On Thu, Apr 10, 2014 at 11:15 AM, Arno Wagner <arno@wagner.name> wrote:
> Just added this to the Wiki-Version of the FAQ as Item 2.19, if
> anybody wants to have a look and comment.
>
> Arno
>
>
Your example uses a syntax that is marked as being "obsolete" in the man
page.
There is an error in your example as that syntax expects the device to be
the last argument,not the mapper path.Your example fail with the following
error:
[root@mtz ink]# cryptsetup create -d /dev/urandom /dev/loop0 to_be_wiped
Device to_be_wiped doesn't exist or access denied.
[root@mtz ink]#
[-- Attachment #2: Type: text/html, Size: 1071 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dm-crypt] Filling a disk with random data - question
2014-04-10 15:50 ` .. ink ..
@ 2014-04-10 16:09 ` Arno Wagner
0 siblings, 0 replies; 8+ messages in thread
From: Arno Wagner @ 2014-04-10 16:09 UTC (permalink / raw)
To: dm-crypt
Thanks, fixed.
Arno
On Thu, Apr 10, 2014 at 17:50:20 CEST, .. ink .. wrote:
> On Thu, Apr 10, 2014 at 11:15 AM, Arno Wagner <arno@wagner.name> wrote:
>
> > Just added this to the Wiki-Version of the FAQ as Item 2.19, if
> > anybody wants to have a look and comment.
> >
> > Arno
> >
> >
> Your example uses a syntax that is marked as being "obsolete" in the man
> page.
>
> There is an error in your example as that syntax expects the device to be
> the last argument,not the mapper path.Your example fail with the following
> error:
>
> [root@mtz ink]# cryptsetup create -d /dev/urandom /dev/loop0 to_be_wiped
> Device to_be_wiped doesn't exist or access denied.
> [root@mtz ink]#
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
--
Arno Wagner, Dr. sc. techn., Dipl. Inform., Email: arno@wagner.name
GnuPG: ID: CB5D9718 FP: 12D6 C03B 1B30 33BB 13CF B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. - Plato
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-04-10 16:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-17 18:55 [dm-crypt] Filling a disk with random data - question Cpp
2014-03-17 23:17 ` .. ink ..
2014-03-18 2:33 ` Arno Wagner
2014-03-18 22:20 ` Robert Nichols
2014-03-18 23:41 ` [dm-crypt] Filling a disk with random data - use a hige bs= to speed it up Chris Drake
2014-04-10 15:15 ` [dm-crypt] Filling a disk with random data - question Arno Wagner
2014-04-10 15:50 ` .. ink ..
2014-04-10 16:09 ` Arno Wagner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.