]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man4/gbde.4
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man4 / gbde.4
1 .\"
2 .\" Copyright (c) 2002 Poul-Henning Kamp
3 .\" Copyright (c) 2002 Networks Associates Technology, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 .\" and NAI Labs, the Security Research Division of Network Associates, Inc.
8 .\" under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
9 .\" DARPA CHATS research program.
10 .\"
11 .\" Redistribution and use in source and binary forms, with or without
12 .\" modification, are permitted provided that the following conditions
13 .\" are met:
14 .\" 1. Redistributions of source code must retain the above copyright
15 .\"    notice, this list of conditions and the following disclaimer.
16 .\" 2. Redistributions in binary form must reproduce the above copyright
17 .\"    notice, this list of conditions and the following disclaimer in the
18 .\"    documentation and/or other materials provided with the distribution.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\" $FreeBSD$
33 .\"
34 .Dd October 19, 2002
35 .Dt GBDE 4
36 .Os
37 .Sh NAME
38 .Nm gbde
39 .Nd Geom Based Disk Encryption
40 .Sh SYNOPSIS
41 .Cd "options GEOM_BDE"
42 .Sh DESCRIPTION
43 .Bf -symbolic
44 NOTICE:
45 Please be aware that this code has not yet received much review
46 and analysis by qualified cryptographers and therefore should be considered
47 a slightly suspect experimental facility.
48 .Pp
49 We cannot at this point guarantee that the on-disk format will not change
50 in response to reviews or bug-fixes, so potential users are advised to
51 be prepared that
52 .Xr dump 8 Ns / Ns Xr restore 8
53 based migrations may be called for in the future.
54 .Ef
55 .Pp
56 The objective of this facility is to provide a high degree of
57 denial of access to the contents of a
58 .Dq cold
59 storage device.
60 .Pp
61 Be aware that if the computer is compromised while up and running
62 .Em and
63 the storage device is actively attached and opened with a valid
64 pass-phrase, this facility offers no protection or denial of access
65 to the contents of the storage device.
66 .Pp
67 If, on the other hand, the device is
68 .Dq cold ,
69 it should present a formidable
70 challenge for an attacker to gain access to the contents in the absence of
71 a valid pass-phrase.
72 .Pp
73 Four cryptographic barriers must be passed to gain access to the data,
74 and only a valid pass-phrase will yield this access.
75 .Pp
76 When the pass-phrase is entered, it is hashed with SHA2 into a 512 bit
77 .Dq key-material .
78 This is a way of producing cryptographic usable keys from a typically
79 .No all- Ns Tn ASCII
80 pass-phrase of an unpredictable user-selected length.
81 .Ss First barrier: the location of the \&"lock-sector".
82 During initialization, up to four independent but mutually aware
83 .Dq lock
84 sectors are written to the device in randomly chosen
85 locations.
86 These lock-sectors contain the 2048 random bit master-key and a number
87 of parameters of the layout geometry (more on this later).
88 Since the entire device will contain isotropic data, there is no
89 short-cut to rapidly determine which sequence of bytes contain a lock-sector.
90 .Pp
91 To locate a lock-sector, a small piece of data called the
92 .Dq metadata
93 and the key-material must be available.
94 The key-material decrypts the
95 metadata, which contains the byte offset on the device where the
96 corresponding lock-sector is located.
97 If the metadata is lost or unavailable but the key-material is at
98 hand, it would be feasible to do a brute force scan where each byte offset
99 of the device is checked to see if it contains the lock-sector data.
100 .Ss Second barrier: decryption of the master-key using key-material.
101 The lock-sector contains an encrypted copy of an architecture neutral
102 byte-sequence which encodes the fields of the lock-structure.
103 The order in which these fields are encoded is determined from the key-material.
104 The encoded byte stream is encrypted with 256bit AES in CBC mode.
105 .Ss Third barrier: decryption of the sector key.
106 For each sector, an MD5 hash over a
107 .Dq salt
108 from the lock-sector and the sector number is used to
109 .Dq cherry-pick
110 a subset of the master key,
111 which hashed together with the sector offset through MD5 produces the
112 .Dq kkey ,
113 the key which encrypts the sector key.
114 .Ss Fourth barrier: decryption of the sector data.
115 The actual payload of the sector is encrypted with 128 bit AES in CBC mode
116 using a single-use random bits key.
117 .Ss Examining the reverse path
118 Assuming an attacker knows an amount of plaintext and has managed to
119 locate the corresponding encrypted sectors on the device, gaining access
120 to the plaintext context of other sectors is a daunting task:
121 .Pp
122 First he will have to derive from the encrypted sector and the known plain
123 text the sector key(s) used.
124 At the time of writing, it has been speculated that it could maybe be
125 possible to break open AES in only 2^80 operations; even so, that is still
126 a very impossible task.
127 .Pp
128 Armed with one or more sector keys, our patient attacker will then go
129 through essentially the same exercise, using the sector key and the
130 encrypted sector key to find the key used to encrypt the sector key.
131 .Pp
132 Armed with one or more of these
133 .Dq kkeys ,
134 our attacker has to
135 run them backwards through MD5.
136 Even though he knows that the input to MD5 was 24 bytes and has the value
137 of 8 of these bytes from the sector number, he is still faced with 2^128
138 equally likely possibilities.
139 .Pp
140 Having successfully done that, our attacker has successfully discovered
141 up to 16 bytes of the master-key, but is still unaware which 16 bytes,
142 and in which other sectors any of these known bytes contribute to the kkey.
143 .Pp
144 To unravel the last bit, the attacker has to guess the 16 byte random-bits
145 salt stored in the lock-sector to recover the indexes into the masterkey.
146 .Pp
147 Any attacker with access to the necessary machine power to even attempt
148 this attack will be better off attempting to brute-force the pass-phrase.
149 .Ss Positive denial facilities
150 Considering the infeasibility of the above attack,
151 gaining access to the pass-phrase will be of paramount importance for an
152 attacker,
153 and a number of scenarios can be imagined where undue pressure will be
154 applied to an individual to divulge the pass-phrase.
155 .Pp
156 A
157 .Dq Blackening
158 feature provides a way for the user, given a moment of
159 opportunity, to destroy the master-key in such a way that the pass-phrase
160 will be acknowledged as good but access to the data will still be
161 denied.
162 .Ss A practical analogy
163 For persons who think cryptography is only slightly more interesting than
164 watching silicon sublimate the author humbly offers this analogy to the
165 keying scheme for a protected device:
166 .Pp
167 Imagine an installation with a vault with walls of several hundred meters
168 thick solid steel.
169 This vault can only be feasibly accessed using the
170 single key, which has a complexity comparable to a number with 600 digits.
171 .Pp
172 This key exists in four copies, each of which is stored in one of
173 four small safes, each of which can be opened
174 with unique key which has a complexity comparable to an 80 digit
175 number.
176 .Pp
177 In addition to the masterkey, each of the four safes also contains
178 the exact locations of all four key-safes which are located in
179 randomly chosen places on the outside surface of the vault where they
180 are practically impossible to detect when they are closed.
181 .Pp
182 Finally, each safe contains four switches which are wired to a bar
183 of dynamite inside each of the four safes.
184 .Pp
185 In addition to this, a keyholder after opening his key-safe is
186 also able to install a copy of the master-key and re-key any of
187 key-safes (including his own).
188 .Pp
189 In normal use, the user will open the safe for which he has the key,
190 take out the master-key and access the vault.
191 When done, he will lock up the master-key in the safe again.
192 .Pp
193 If a keyholder-X for some reason distrusts keyholder-Y, she
194 has the option of opening her own safe, flipping one of the switches
195 and detonating the bar of dynamite in safe-Y.
196 This will obliterate the master-key in that safe and thereby deny
197 keyholder-Y access to the vault.
198 .Pp
199 Should the facility come under attack, any of the keyholders can detonate
200 all four bars of dynamite and thereby make sure that access to the
201 vault is denied to everybody, keyholders and attackers alike.
202 Should the facility fall to the enemy, and a keyholder be forced to apply
203 his personal key, he can do so in confidence that the contents of his safe
204 will not yield access to the vault, and the enemy will hopefully realize
205 that applying further pressure on the personnel will not give access to
206 the vault.
207 .Pp
208 The final point to make here is that it is perfectly possible to
209 make a detached copy of any one of these keys, including the master
210 key, and deposit or hide it as one sees fit.
211 .Ss Steganography support
212 When the device is initialized, it is possible to restrict the encrypted
213 data to a single contiguous area of the device.
214 If configured with care, this area could masquerade as some sort of
215 valid data or as random trash left behind by the systems operation.
216 .Pp
217 This can be used to offer a plausible deniability of existence, where
218 it will be impossible to prove that this specific area of the device
219 is in fact used to store encrypted data and not just random junk.
220 .Pp
221 The main obstacle in this is that the output from any encryption algorithm
222 worth its salt is so totally random looking that it stands out like a sore
223 thumb amongst practically any other sort of data which contains at least
224 some kind of structure or identifying byte sequences.
225 .Pp
226 Certain file formats like ELF contain multiple distinct sections, and it
227 would be possible to locate things just right in such a way that a device
228 contains a partition with a file system with a large executable,
229 .Pq Dq "a backup copy of my kernel"
230 where a non-loaded ELF section is laid out
231 consecutively on the device and thereby could be used to contain a
232 .Nm
233 encrypted device.
234 .Pp
235 Apart from the ability to instruct
236 .Nm
237 which those sectors are, no support is provided for creating such a setup.
238 .Ss Deployment suggestions
239 For personal use, it may be wise to make a backup copy of the masterkey
240 or use one of the four keys as a backup.
241 Fitting protection of this key is up to yourself, your local circumstances and
242 your imagination.
243 .Pp
244 For company or institutional use, it is strongly advised to make a copy
245 of the master-key and put it under whatever protection you have at your
246 means.
247 If you fail to do this, a disgruntled employee can deny you access to
248 the data
249 .Dq "by accident" .
250 (The employee can still intentionally deny access by applying another
251 encryption scheme to the data, but that problem has no technical solution.)
252 .Ss Cryptographic strength
253 This section lists the specific components which contribute to the cryptographic
254 strength of
255 .Nm .
256 .Pp
257 The payload is encrypted with AES in CBC mode using a 128 bit random
258 single-use key
259 .Pq Dq "the skey" .
260 AES is well documented.
261 .Pp
262 No IV is used in the encryption of the sectors, the assumption being
263 that since the key is random bits and single-use, an IV adds nothing to the
264 security of AES.
265 .Pp
266 The random key is produced with
267 .Xr arc4rand 9
268 which is believed to do a respectable job at producing unpredictable bytes.
269 .Pp
270 The skey is stored on the device in a location which can be derived from
271 the location of the encrypted payload data.
272 The stored copy is encrypted with AES in CBC mode using a 128 bit key
273 .Pq Dq "the kkey"
274 derived
275 from a subset of the master key chosen by the output of an MD5 hash
276 over a 16 byte random bit static salt and the sector offset.
277 Up to 6.25% of the masterkey (16 bytes out of 2048 bits) will be selected
278 and hashed through MD5 with the sector offset to generate the kkey.
279 .Pp
280 Up to four copies of the master-key and associated geometry information
281 is stored on the device in static randomly chosen sectors.
282 The exact location inside the sector is randomly chosen.
283 The order in which the fields are encoded depends on the key-material.
284 The encoded byte-stream is encrypted with AES in CBC mode using 256 bit
285 key-material.
286 .Pp
287 The key-material is derived from the user-entered pass-phrase using
288 512 bit SHA2.
289 .Pp
290 No chain is stronger than its weakest link, which usually is poor pass-phrases.
291 .Sh SEE ALSO
292 .Xr gbde 8
293 .Sh HISTORY
294 This software was developed for the
295 .Fx
296 Project by
297 .An Poul-Henning Kamp
298 and NAI Labs, the Security Research Division of Network Associates, Inc.\&
299 under DARPA/SPAWAR contract N66001-01-C-8035
300 .Pq Dq CBOSS ,
301 as part of the
302 DARPA CHATS research program.
303 .Sh AUTHORS
304 .An "Poul-Henning Kamp" Aq phk@FreeBSD.org