Notes on the cryptography used for disk encryption.

Background

Ciphers

Block Device Considerations

Requirements for encryption of data on a block file system device are quite different than requirements for encrypting a single file or a long stream of data. In particular:

Cipher Mode

A block cipher operates on fairly small blocks of data, generally 8 to 16 bytes. The mode defines how data larger than the block size is encrypted. The simplest mode is ECB (electronic code book) where each block is encrypted using only the key. The same data produce the same results no matter where the block is in the data stream. The other modes use some data other than the key (an random IV (initialization vector), the results of a previous operation, a numeric sequence, etc.) to modify the encryption process for each block. A cipher mode used for block device encryption has different requirements than a mode for encrypting a file that is read or written from the beginning to the end since any arbitrary block of data in the device may need to be read or written.

Of the traditional modes, the general consensus is that ECB is not suitable for this job. AES-CBC-plain is better but still offers a few potential exposures. CBC-ESSIV is a popular mode for disk encryption software and seems to be a reasonable choice.

In recent years, modes designed for block device encryption have been developed. LRW, XEX, and XTS are tweakable narrow-block encryption modes. (XTS: XEX TCB with ciphertext stealing and is a narrow-block cryptographic mode. (XEX stands for 'XOR-Encrypt-XOR', and TCB is Tweakable CodeBook mode encryption)). CMC and EME are wide-block encryption modes.

Standardization in cypher modes is being addressed by the IEEE 1619 Security In Storage Working Group (SISWG).

Questions to Ask

Randomness

Key Storage and Encryption

How and where the keys are stored are probably the most critical security aspect of these products. The simplest ones (cryptoloop,loop-AES,dm-crypt) use a single master key that the system manager must manage himself. Loss of this key means the data are not recoverable. Changing this key requires re-encrypting the data. Better applications (dm-crypt/LUKS,TrueCrypt, most commercial) create a master encryption key and encrypt it for multiple user keys. Any one of these keys can be used to decrypt the data, and any of them can be removed or changed without changing the master encryption key.

One area to worry about here is exactly how "remote help" is provided. One secure way to do this is to encrypt the master key for a user key known to the help provider and see that he has a current copy. It is critical to understand how this remote help service is provided to assure that there isn't some unknown key used to encrypt the master key. A good sign of this would be if remote help can be given without access to any data from the encrypted host.

Questions

Scope of Encryption

OS/Hardware Integration

General

Compatibility

These issues relate to the migration from one product to another or sharing encrypted containers between platforms.