3.2 TransCrypt Architecture
3.2.5 User space Modules
3.2.5.1 TransCrypt daemon
Transcryptd is a mechanism for the kernel to get certificates for the users and to do private key operations implemented in program to run in user space. It performs the
following two tasks.
• Retrieval of user certificates from the certificate repository (/usr/local/etc/transcrypt/certs) when there is a miss in the kernel certificate cache.
• Forwarding of all messages for private key based operations to auth server.
3.2.5.2 Transcrypt authserver
This is an interface to subject’s PKS, such as Smart Card, USB drive, etc. Earlier version of TransCrypt auth [12, 13] supported only file based PKS. In these versions a token decryption request is sent by transcryptd to transcrypt-auth. It checks the
certab file (This file stores the mappings of subject’s certid and the corresponding private key file location) and gets the private key to decrypt the token that is then replied back to transcryptd for forwarding it to the kernel.
3.2.5.3 Utilities
There were two wrapper utilities to mount and mkfs programs, namelymount.transcrypt
and mkfs.transcrypt for mounting and creating TransCrypt volumes.
1. mkfs.transcrypt: This program is a wrapper over the standard mke2fs [20] pro- gram for creating a TransCrypt volume. This program prompts the adminis- trator creating the new file system for a passphrase and derives the FSK from it using the standard Passphrase Based Key Derivation Function (PBKDF2). This FSK is then passed to mke2fs that initializes the extended attribute. 2. mount.transcrypt: This program is a wrapper over the standardmount [21] util-
ity for mounting a TransCrypt volume. This utility accepts the pass phrase from the user and then generates the FSK from it as was done in mkfs.transcrypt.
FSK is then hashed and then passed to the kernel using configfs [22]. After passing the FSK through the configfs, it mounts the file system using the stan- dard mount mechanism. The kernel then checks the FSK with the one stored in the extended attribute. It succeeds only if both FSK hash values match.
Apart from these utilities, there are some helper scripts for adding and removing the user certificates from the certificate store. Similar helper scripts are written to add private keys information to be used by TransCrypt authserver.
Chapter 4
TransCrypt Configuration
Earlier versions of TransCrypt [11, 12, 13] used themkfs.transcrypt and mount.transcrypt
utilities to pass configuration parameters such as cipher specification, key lengths etc to the TransCrypt kernel. In this thesis work, we remove the dependency on these helper utilities by passing these configuration parameters through a standard utility called dmsetup.
4.1
Configuration Parameters
TransCrypt requires the following parameters to be configured before it can be used. FEK Cipherspec: This field corresponds to the cipher specification containing the algorithm, the chaining method and the IV options for file encryption. The format of this field is“<FEK algorithm>–<Chaining mode>–<iv options>”. For example, “aes-cbc-plain” denotes AES encryption algorithm with cipher- block chaining (CBC) mode and plain mode of IV (i.e. the initial vector is the sector number, padded with zeros if necessary). The possible values for algorithm, chaining mode and IV options are shown in the following table.
FEK Algorithm aes, des Chaining mode ecb, cbc
IV options null, plain, essiv
FEK size: This field corresponds to the length of the File Encryption Key (FEK) in bits such as 128, 256 etc.
FSK Cipherspec: This field corresponds to the cipher specification containing the algorithm, the chaining method and IV options to encrypt FEK. The format of this field is same as that of theFEK_Cipherspec.
FSK size: This field corresponds to the length of the File System Key (FSK) in bits such as 128, 256 etc.
FSK: FSK is a system wide key. This symmetric key is used to blind the FEK preventing its exposure. It is passed through a configfs [22] subsystem into the kernel.
4.2
Design
In the earlier implementation of TransCrypt, the configuration parameters were com- bined as a single byte array and were stored the root directory’s “user.transcrypt.params” extended attribute. This attribute is created by themkfs.transcrypt when initial- izing the volume. This user.transcrypt.params is read by TransCrypt kernel at mount time and extracts parameters in the in-core struct.
The earlier implementation [11, 12, 13] was therefore dependent on two helper utilities, mkfs.transcrypt and mount.transcrypt for handling configuration pa- rameters. As a part of this work, we remove the dependencies on these user space
wrapper utilities. In our implementation, the standard mkfs and mount utilities can be used for creating and mounting TransCrypt volumes.
The configuration parameters are now passed through the standard dmsetup
command to the device mapper module, dm-transcrypt. dm-transcrypt module’s constructor parses these parameters and stores them in in-core kernel data struc- ture. When the TransCrypt volume is mounted for the first time, these parameters are extracted from dm-transcrypt’s in-core structure and stored in the root direc- tory’s extended attribute. In subsequent mount operations, the parameters stored in extended attribute and parameters provided by the user (through dmsetup) are compared. The mount operation (Algorithm 1) succeeds only if both these sets of configuration parameters match. If a user does not provide configuration parameters through dmsetup in subsequent mount operations, then the TransCrypt kernel uses parameters from the extended attribute.
Algorithm 1: TransCrypt Mount Operation Data: Mount Point
Result: error or success
if Mount point 6= transcrypt volume then
1 return success; 2 end 3 transcrypt-ea-params ← vfs-get-xattr(); 4 transcrypt-dm-params ← get-dm-params(); 5
if transcrypt-ea-params not set then
6
if transcrypt-dm-params not set then
7
/* Use default transcrypt params */
transcrypt-params ← transcrypt-default-params;
8
else
9
/* Use dmsetup transcrypt params */
transcrypt-params ← transcrypt-dm-params;
10
end
11
/* Store params in the extended attribute */ vfs-set-xattr(transcrypt-params);
12
else if transcrypt-dm-params not set then
13
/* Store transcrypt params from extended attribute */
transcrypt-params ← transcrypt-ea-params;
14
else
15
/* Compare both the params */
if transcrypt-dm-params 6= transcrypt-ea-params then
16
/* If they are not matched then return an error */
return error; 17 else 18 transcrypt-params ← transcrypt-ea-params; 19 return success; 20 end 21 end 22 return success; 23 34