aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorRoberto Sassu <roberto.sassu@polito.it>2011-06-27 07:45:44 -0400
committerMimi Zohar <zohar@linux.vnet.ibm.com>2011-06-27 09:11:17 -0400
commit79a73d188726b473ca3bf483244bc96096831905 (patch)
tree787ba050c91981cae2524b1e95e415424b067e64 /Documentation
parentf8f8527103a264b5e4ab2ce5c1743b28f3219d90 (diff)
encrypted-keys: add ecryptfs format support
The 'encrypted' key type defines its own payload format which contains a symmetric key randomly generated that cannot be used directly to mount an eCryptfs filesystem, because it expects an authentication token structure. This patch introduces the new format 'ecryptfs' that allows to store an authentication token structure inside the encrypted key payload containing a randomly generated symmetric key, as the same for the format 'default'. More details about the usage of encrypted keys with the eCryptfs filesystem can be found in the file 'Documentation/keys-ecryptfs.txt'. Signed-off-by: Roberto Sassu <roberto.sassu@polito.it> Acked-by: Gianluca Ramunno <ramunno@polito.it> Acked-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/keys-ecryptfs.txt68
-rw-r--r--Documentation/security/keys-trusted-encrypted.txt6
2 files changed, 72 insertions, 2 deletions
diff --git a/Documentation/keys-ecryptfs.txt b/Documentation/keys-ecryptfs.txt
new file mode 100644
index 000000000000..c3bbeba63562
--- /dev/null
+++ b/Documentation/keys-ecryptfs.txt
@@ -0,0 +1,68 @@
1 Encrypted keys for the eCryptfs filesystem
2
3ECryptfs is a stacked filesystem which transparently encrypts and decrypts each
4file using a randomly generated File Encryption Key (FEK).
5
6Each FEK is in turn encrypted with a File Encryption Key Encryption Key (FEFEK)
7either in kernel space or in user space with a daemon called 'ecryptfsd'. In
8the former case the operation is performed directly by the kernel CryptoAPI
9using a key, the FEFEK, derived from a user prompted passphrase; in the latter
10the FEK is encrypted by 'ecryptfsd' with the help of external libraries in order
11to support other mechanisms like public key cryptography, PKCS#11 and TPM based
12operations.
13
14The data structure defined by eCryptfs to contain information required for the
15FEK decryption is called authentication token and, currently, can be stored in a
16kernel key of the 'user' type, inserted in the user's session specific keyring
17by the userspace utility 'mount.ecryptfs' shipped with the package
18'ecryptfs-utils'.
19
20The 'encrypted' key type has been extended with the introduction of the new
21format 'ecryptfs' in order to be used in conjunction with the eCryptfs
22filesystem. Encrypted keys of the newly introduced format store an
23authentication token in its payload with a FEFEK randomly generated by the
24kernel and protected by the parent master key.
25
26In order to avoid known-plaintext attacks, the datablob obtained through
27commands 'keyctl print' or 'keyctl pipe' does not contain the overall
28authentication token, which content is well known, but only the FEFEK in
29encrypted form.
30
31The eCryptfs filesystem may really benefit from using encrypted keys in that the
32required key can be securely generated by an Administrator and provided at boot
33time after the unsealing of a 'trusted' key in order to perform the mount in a
34controlled environment. Another advantage is that the key is not exposed to
35threats of malicious software, because it is available in clear form only at
36kernel level.
37
38Usage:
39 keyctl add encrypted name "new ecryptfs key-type:master-key-name keylen" ring
40 keyctl add encrypted name "load hex_blob" ring
41 keyctl update keyid "update key-type:master-key-name"
42
43name:= '<16 hexadecimal characters>'
44key-type:= 'trusted' | 'user'
45keylen:= 64
46
47
48Example of encrypted key usage with the eCryptfs filesystem:
49
50Create an encrypted key "1000100010001000" of length 64 bytes with format
51'ecryptfs' and save it using a previously loaded user key "test":
52
53 $ keyctl add encrypted 1000100010001000 "new ecryptfs user:test 64" @u
54 19184530
55
56 $ keyctl print 19184530
57 ecryptfs user:test 64 490045d4bfe48c99f0d465fbbbb79e7500da954178e2de0697
58 dd85091f5450a0511219e9f7cd70dcd498038181466f78ac8d4c19504fcc72402bfc41c2
59 f253a41b7507ccaa4b2b03fff19a69d1cc0b16e71746473f023a95488b6edfd86f7fdd40
60 9d292e4bacded1258880122dd553a661
61
62 $ keyctl pipe 19184530 > ecryptfs.blob
63
64Mount an eCryptfs filesystem using the created encrypted key "1000100010001000"
65into the '/secret' directory:
66
67 $ mount -i -t ecryptfs -oecryptfs_sig=1000100010001000,\
68 ecryptfs_cipher=aes,ecryptfs_key_bytes=32 /secret /secret
diff --git a/Documentation/security/keys-trusted-encrypted.txt b/Documentation/security/keys-trusted-encrypted.txt
index 0afcb5023c75..5f50ccabfc8a 100644
--- a/Documentation/security/keys-trusted-encrypted.txt
+++ b/Documentation/security/keys-trusted-encrypted.txt
@@ -63,7 +63,7 @@ Usage:
63 keyctl add encrypted name "load hex_blob" ring 63 keyctl add encrypted name "load hex_blob" ring
64 keyctl update keyid "update key-type:master-key-name" 64 keyctl update keyid "update key-type:master-key-name"
65 65
66format:= 'default' 66format:= 'default | ecryptfs'
67key-type:= 'trusted' | 'user' 67key-type:= 'trusted' | 'user'
68 68
69 69
@@ -154,4 +154,6 @@ Load an encrypted key "evm" from saved blob:
154 24717c64 5972dcb82ab2dde83376d82b2e3c09ffc 154 24717c64 5972dcb82ab2dde83376d82b2e3c09ffc
155 155
156Other uses for trusted and encrypted keys, such as for disk and file encryption 156Other uses for trusted and encrypted keys, such as for disk and file encryption
157are anticipated. 157are anticipated. In particular the new format 'ecryptfs' has been defined in
158in order to use encrypted keys to mount an eCryptfs filesystem. More details
159about the usage can be found in the file 'Documentation/keys-ecryptfs.txt'.