Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Randomizing LUKS Partition
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1261
Location: Idaho, USA

PostPosted: Fri Apr 17, 2009 10:33 pm    Post subject: Randomizing LUKS Partition Reply with quote

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
View user's profile Send private message
Sadako
Advocate
Advocate


Joined: 05 Aug 2004
Posts: 3792
Location: sleeping in the bathtub

PostPosted: Fri Apr 17, 2009 11:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23064

PostPosted: Sat Apr 18, 2009 3:18 am    Post subject: Reply with quote

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
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Sat Apr 18, 2009 10:05 am    Post subject: Reply with quote

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
View user's profile Send private message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1261
Location: Idaho, USA

PostPosted: Sat Apr 18, 2009 10:34 am    Post subject: Reply with quote

I was COMPLETELY drunk when I posted this and forgot all about it. 8O

Anyway, thanks.
_________________
Git has obsoleted SVN.
10mm Auto has obsoleted 45 ACP.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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