- Request a password from factotum.
- Use ``Password Based Key Derivation Function 2.0'' (PKCS#5) to
derive a key from the password. The salt, number of rounds and
number of bits are taken from the header.
- The initialization vector from the header and the derived key
are used to decrypt the actual key used for encrypting/decrypting.
The data decrypted is actually:
random cookie || key || (sha1 of random cookie || key || header).
Use of the key derivation function makes password guessing inefficient
(the salt prevents use of pre-calculated dictionaries). Using a
key stored in the header, instead of directly using the derived
key, makes it possible to change the password without having to
re-encrypt all data. The (encrypted) SHA1-hash along with the
(encrypted) key allows verification of the user-entered password,
preventing misinterpretation and possible destruction (by overwriting
by e.g. file system repair tools) of data.
XTS (XEX-TCB-CTS (sic)) is the recommended mode. It is a ``tweaked''
mode and ensures that each sector has a different ciphertext, even
when storing the same data. The CTS part is for sector sizes that
are not a multiple of the encryption algorithm block size. Since
this is very uncommon, it is not implemented.
The CBC-mode encrypts each sector in CBC-mode with the encrypted
sector number as IV. This too ensures that a plaintext has a
different ciphertext on each sector it is stored.
mount {cryptfile -i -m aes-xts -l 128 $home/encrypted} /n/decrypted/
mount {disk/kfs -r /n/decrypted/data} /n/kfs
And to mount a previously initialized encrypted file:
mount {cryptfile $home/encrypted} /n/decrypted/
| CRYPTFILE(4 ) | Rev: Wed Aug 19 15:29:19 GMT 2009 |