Re: Partitions on loopback
Jari Ruusu <jariruusu <at> users.sourceforge.net>
2005-04-02 09:00:56 GMT
Gabriel Jägenstedt wrote:
> Could I just ask why you gave different keys for each device?
Because that provides better protection against identical ciphertexts.
Identical ciphertexts using same encryption key are bad because they leak
information.
When sector data is encrypted or decrypted, position information within a
partition or device is used in IV computation and in multi-key mode to also
to select the encryption key. This provides reasonable guarantee that when
same data is written to more than one sectors, ciphertexts will be different
and attacker observing ciphertexts can't find out what plaintext sectors
contain identical data. If same key file is used to encrypt more than one
file system, there is a danger that same data + same encryption key + same
position info will result in identical ciphertexts.
Examples:
(A) losetup -e AES128 -K foo1.gpg /dev/loop1 /dev/hda1
(B) losetup -e AES128 -K foo2.gpg /dev/loop2 /dev/hda2
(C) losetup -e AES128 -K foo3.gpg /dev/loop3 /dev/hda3
(D) losetup -e AES128 -K foo1.gpg -o <at> 32256 -s 24643584 /dev/loop1 /dev/hda
(E) losetup -e AES128 -K foo2.gpg -o <at> 24675840 -s 5733020160 /dev/loop2 /dev/hda
(F) losetup -e AES128 -K foo3.gpg -o <at> 5757696000 -s 526417920 /dev/loop3 /dev/hda
(G) losetup -e AES128 -K foo1.gpg -o 32256 -s 24643584 /dev/loop1 /dev/hda
(H) losetup -e AES128 -K foo2.gpg -o 24675840 -s 5733020160 /dev/loop2 /dev/hda
(I) losetup -e AES128 -K foo3.gpg -o 5757696000 -s 526417920 /dev/loop3 /dev/hda
In examples (A), (B), (C), (D), (E), and (F), first loop device sector is
encrypted using position info 0, second sector using position info 512,
third sector using position info 1024, and so on. In example (G) first loop
(Continue reading)