View previous topic :: View next topic |
Author |
Message |
wswartzendruber Veteran
Joined: 23 Mar 2004 Posts: 1261 Location: Idaho, USA
|
Posted: Fri Apr 17, 2009 10:33 pm Post subject: Randomizing LUKS Partition |
|
|
Instead of,
Code: | cat /dev/urandom > /dev/sda2 |
Can I not just say,
Code: | cat /dev/zero > /dev/mapper/root |
Once the partition has been initialized? Of course, I should start things off with some random data to get the initialization vector random, so maybe something like,
Code: | dd if=/dev/urandom of=random bs=1M count=1
cat random /dev/zero > /dev/mapper/root |
Comments? _________________ Git has obsoleted SVN.
10mm Auto has obsoleted 45 ACP. |
|
Back to top |
|
|
Sadako Advocate
Joined: 05 Aug 2004 Posts: 3792 Location: sleeping in the bathtub
|
Posted: Fri Apr 17, 2009 11:11 pm Post subject: |
|
|
You've got the right idea, but what's better is to actually create a random cryptsetup mapping first, with a completely random key, like so; Code: | cryptsetup -c aes-xts-plain -s 256 -d /dev/urandom create root_random /dev/sda2 | then fill /dev/mapper/root_random from /dev/zero, then remove that mapping and create the luks one. _________________ "You have to invite me in" |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23064
|
Posted: Sat Apr 18, 2009 3:18 am Post subject: |
|
|
Zeroing the plaintext volume encrypted by your longterm master key is probably not a good idea. You are better off having the unused regions be truly random, or at least filled with data encrypted by a different key, as suggested by Hopeless.
If the attacker knows an area decrypts to all zeroes, then applying a brute force attack is a bit easier, since he only needs to find a key+IV that produces an all zero output, as opposed to analyzing the output to see if it looks plausible for a filesystem. However, with a good key and a good algorithm free from design weaknesses, such an attack should still be impractical today. |
|
Back to top |
|
|
nixnut Bodhisattva
Joined: 09 Apr 2004 Posts: 10974 Location: the dutch mountains
|
Posted: Sat Apr 18, 2009 10:05 am Post subject: |
|
|
Moved from Installing Gentoo to Networking & Security.
not about getting gentoo installed, so moved here _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
talk is cheap. supply exceeds demand |
|
Back to top |
|
|
wswartzendruber Veteran
Joined: 23 Mar 2004 Posts: 1261 Location: Idaho, USA
|
Posted: Sat Apr 18, 2009 10:34 am Post subject: |
|
|
I was COMPLETELY drunk when I posted this and forgot all about it.
Anyway, thanks. _________________ Git has obsoleted SVN.
10mm Auto has obsoleted 45 ACP. |
|
Back to top |
|
|
|