xref: /freebsd/lib/geom/eli/geli.8 (revision e4b0a90e771b94e4b043729a6f0f5564f1d01aca)
1*e4b0a90eSBrooks Davis.\" Copyright (c) 2005-2011 Pawel Jakub Dawidek <pawel@dawidek.net>
2*e4b0a90eSBrooks Davis.\" All rights reserved.
3*e4b0a90eSBrooks Davis.\"
4*e4b0a90eSBrooks Davis.\" Redistribution and use in source and binary forms, with or without
5*e4b0a90eSBrooks Davis.\" modification, are permitted provided that the following conditions
6*e4b0a90eSBrooks Davis.\" are met:
7*e4b0a90eSBrooks Davis.\" 1. Redistributions of source code must retain the above copyright
8*e4b0a90eSBrooks Davis.\"    notice, this list of conditions and the following disclaimer.
9*e4b0a90eSBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright
10*e4b0a90eSBrooks Davis.\"    notice, this list of conditions and the following disclaimer in the
11*e4b0a90eSBrooks Davis.\"    documentation and/or other materials provided with the distribution.
12*e4b0a90eSBrooks Davis.\"
13*e4b0a90eSBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14*e4b0a90eSBrooks Davis.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15*e4b0a90eSBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16*e4b0a90eSBrooks Davis.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17*e4b0a90eSBrooks Davis.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18*e4b0a90eSBrooks Davis.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19*e4b0a90eSBrooks Davis.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20*e4b0a90eSBrooks Davis.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21*e4b0a90eSBrooks Davis.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22*e4b0a90eSBrooks Davis.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23*e4b0a90eSBrooks Davis.\" SUCH DAMAGE.
24*e4b0a90eSBrooks Davis.\"
25*e4b0a90eSBrooks Davis.\" $FreeBSD$
26*e4b0a90eSBrooks Davis.\"
27*e4b0a90eSBrooks Davis.Dd May 9, 2018
28*e4b0a90eSBrooks Davis.Dt GELI 8
29*e4b0a90eSBrooks Davis.Os
30*e4b0a90eSBrooks Davis.Sh NAME
31*e4b0a90eSBrooks Davis.Nm geli
32*e4b0a90eSBrooks Davis.Nd "control utility for the cryptographic GEOM class"
33*e4b0a90eSBrooks Davis.Sh SYNOPSIS
34*e4b0a90eSBrooks DavisTo compile GEOM_ELI into your kernel, add the following lines to your kernel
35*e4b0a90eSBrooks Davisconfiguration file:
36*e4b0a90eSBrooks Davis.Bd -ragged -offset indent
37*e4b0a90eSBrooks Davis.Cd "device crypto"
38*e4b0a90eSBrooks Davis.Cd "options GEOM_ELI"
39*e4b0a90eSBrooks Davis.Ed
40*e4b0a90eSBrooks Davis.Pp
41*e4b0a90eSBrooks DavisAlternatively, to load the GEOM_ELI module at boot time, add the following line
42*e4b0a90eSBrooks Davisto your
43*e4b0a90eSBrooks Davis.Xr loader.conf 5 :
44*e4b0a90eSBrooks Davis.Bd -literal -offset indent
45*e4b0a90eSBrooks Davisgeom_eli_load="YES"
46*e4b0a90eSBrooks Davis.Ed
47*e4b0a90eSBrooks Davis.Pp
48*e4b0a90eSBrooks DavisUsage of the
49*e4b0a90eSBrooks Davis.Nm
50*e4b0a90eSBrooks Davisutility:
51*e4b0a90eSBrooks Davis.Pp
52*e4b0a90eSBrooks Davis.Nm
53*e4b0a90eSBrooks Davis.Cm init
54*e4b0a90eSBrooks Davis.Op Fl bdgPTv
55*e4b0a90eSBrooks Davis.Op Fl a Ar aalgo
56*e4b0a90eSBrooks Davis.Op Fl B Ar backupfile
57*e4b0a90eSBrooks Davis.Op Fl e Ar ealgo
58*e4b0a90eSBrooks Davis.Op Fl i Ar iterations
59*e4b0a90eSBrooks Davis.Op Fl J Ar newpassfile
60*e4b0a90eSBrooks Davis.Op Fl K Ar newkeyfile
61*e4b0a90eSBrooks Davis.Op Fl l Ar keylen
62*e4b0a90eSBrooks Davis.Op Fl s Ar sectorsize
63*e4b0a90eSBrooks Davis.Op Fl V Ar version
64*e4b0a90eSBrooks Davis.Ar prov
65*e4b0a90eSBrooks Davis.Nm
66*e4b0a90eSBrooks Davis.Cm label - an alias for
67*e4b0a90eSBrooks Davis.Cm init
68*e4b0a90eSBrooks Davis.Nm
69*e4b0a90eSBrooks Davis.Cm attach
70*e4b0a90eSBrooks Davis.Op Fl Cdprv
71*e4b0a90eSBrooks Davis.Op Fl n Ar keyno
72*e4b0a90eSBrooks Davis.Op Fl j Ar passfile
73*e4b0a90eSBrooks Davis.Op Fl k Ar keyfile
74*e4b0a90eSBrooks Davis.Ar prov
75*e4b0a90eSBrooks Davis.Nm
76*e4b0a90eSBrooks Davis.Cm detach
77*e4b0a90eSBrooks Davis.Op Fl fl
78*e4b0a90eSBrooks Davis.Ar prov ...
79*e4b0a90eSBrooks Davis.Nm
80*e4b0a90eSBrooks Davis.Cm stop - an alias for
81*e4b0a90eSBrooks Davis.Cm detach
82*e4b0a90eSBrooks Davis.Nm
83*e4b0a90eSBrooks Davis.Cm onetime
84*e4b0a90eSBrooks Davis.Op Fl dT
85*e4b0a90eSBrooks Davis.Op Fl a Ar aalgo
86*e4b0a90eSBrooks Davis.Op Fl e Ar ealgo
87*e4b0a90eSBrooks Davis.Op Fl l Ar keylen
88*e4b0a90eSBrooks Davis.Op Fl s Ar sectorsize
89*e4b0a90eSBrooks Davis.Ar prov
90*e4b0a90eSBrooks Davis.Nm
91*e4b0a90eSBrooks Davis.Cm configure
92*e4b0a90eSBrooks Davis.Op Fl bBdDgGtT
93*e4b0a90eSBrooks Davis.Ar prov ...
94*e4b0a90eSBrooks Davis.Nm
95*e4b0a90eSBrooks Davis.Cm setkey
96*e4b0a90eSBrooks Davis.Op Fl pPv
97*e4b0a90eSBrooks Davis.Op Fl i Ar iterations
98*e4b0a90eSBrooks Davis.Op Fl j Ar passfile
99*e4b0a90eSBrooks Davis.Op Fl J Ar newpassfile
100*e4b0a90eSBrooks Davis.Op Fl k Ar keyfile
101*e4b0a90eSBrooks Davis.Op Fl K Ar newkeyfile
102*e4b0a90eSBrooks Davis.Op Fl n Ar keyno
103*e4b0a90eSBrooks Davis.Ar prov
104*e4b0a90eSBrooks Davis.Nm
105*e4b0a90eSBrooks Davis.Cm delkey
106*e4b0a90eSBrooks Davis.Op Fl afv
107*e4b0a90eSBrooks Davis.Op Fl n Ar keyno
108*e4b0a90eSBrooks Davis.Ar prov
109*e4b0a90eSBrooks Davis.Nm
110*e4b0a90eSBrooks Davis.Cm kill
111*e4b0a90eSBrooks Davis.Op Fl av
112*e4b0a90eSBrooks Davis.Op Ar prov ...
113*e4b0a90eSBrooks Davis.Nm
114*e4b0a90eSBrooks Davis.Cm backup
115*e4b0a90eSBrooks Davis.Op Fl v
116*e4b0a90eSBrooks Davis.Ar prov
117*e4b0a90eSBrooks Davis.Ar file
118*e4b0a90eSBrooks Davis.Nm
119*e4b0a90eSBrooks Davis.Cm restore
120*e4b0a90eSBrooks Davis.Op Fl fv
121*e4b0a90eSBrooks Davis.Ar file
122*e4b0a90eSBrooks Davis.Ar prov
123*e4b0a90eSBrooks Davis.Nm
124*e4b0a90eSBrooks Davis.Cm suspend
125*e4b0a90eSBrooks Davis.Op Fl v
126*e4b0a90eSBrooks Davis.Fl a | Ar prov ...
127*e4b0a90eSBrooks Davis.Nm
128*e4b0a90eSBrooks Davis.Cm resume
129*e4b0a90eSBrooks Davis.Op Fl pv
130*e4b0a90eSBrooks Davis.Op Fl j Ar passfile
131*e4b0a90eSBrooks Davis.Op Fl k Ar keyfile
132*e4b0a90eSBrooks Davis.Ar prov
133*e4b0a90eSBrooks Davis.Nm
134*e4b0a90eSBrooks Davis.Cm resize
135*e4b0a90eSBrooks Davis.Op Fl v
136*e4b0a90eSBrooks Davis.Fl s Ar oldsize
137*e4b0a90eSBrooks Davis.Ar prov
138*e4b0a90eSBrooks Davis.Nm
139*e4b0a90eSBrooks Davis.Cm version
140*e4b0a90eSBrooks Davis.Op Ar prov ...
141*e4b0a90eSBrooks Davis.Nm
142*e4b0a90eSBrooks Davis.Cm clear
143*e4b0a90eSBrooks Davis.Op Fl v
144*e4b0a90eSBrooks Davis.Ar prov ...
145*e4b0a90eSBrooks Davis.Nm
146*e4b0a90eSBrooks Davis.Cm dump
147*e4b0a90eSBrooks Davis.Op Fl v
148*e4b0a90eSBrooks Davis.Ar prov ...
149*e4b0a90eSBrooks Davis.Nm
150*e4b0a90eSBrooks Davis.Cm list
151*e4b0a90eSBrooks Davis.Nm
152*e4b0a90eSBrooks Davis.Cm status
153*e4b0a90eSBrooks Davis.Nm
154*e4b0a90eSBrooks Davis.Cm load
155*e4b0a90eSBrooks Davis.Nm
156*e4b0a90eSBrooks Davis.Cm unload
157*e4b0a90eSBrooks Davis.Sh DESCRIPTION
158*e4b0a90eSBrooks DavisThe
159*e4b0a90eSBrooks Davis.Nm
160*e4b0a90eSBrooks Davisutility is used to configure encryption on GEOM providers.
161*e4b0a90eSBrooks Davis.Pp
162*e4b0a90eSBrooks DavisThe following is a list of the most important features:
163*e4b0a90eSBrooks Davis.Pp
164*e4b0a90eSBrooks Davis.Bl -bullet -offset indent -compact
165*e4b0a90eSBrooks Davis.It
166*e4b0a90eSBrooks DavisUtilizes the
167*e4b0a90eSBrooks Davis.Xr crypto 9
168*e4b0a90eSBrooks Davisframework, so when there is crypto hardware available,
169*e4b0a90eSBrooks Davis.Nm
170*e4b0a90eSBrooks Daviswill make use of it automatically.
171*e4b0a90eSBrooks Davis.It
172*e4b0a90eSBrooks DavisSupports many cryptographic algorithms (currently
173*e4b0a90eSBrooks Davis.Nm AES-XTS ,
174*e4b0a90eSBrooks Davis.Nm AES-CBC ,
175*e4b0a90eSBrooks Davis.Nm Blowfish-CBC ,
176*e4b0a90eSBrooks Davis.Nm Camellia-CBC
177*e4b0a90eSBrooks Davisand
178*e4b0a90eSBrooks Davis.Nm 3DES-CBC ) .
179*e4b0a90eSBrooks Davis.It
180*e4b0a90eSBrooks DavisCan optionally perform data authentication (integrity verification) utilizing
181*e4b0a90eSBrooks Davisone of the following algorithms:
182*e4b0a90eSBrooks Davis.Nm HMAC/MD5 ,
183*e4b0a90eSBrooks Davis.Nm HMAC/SHA1 ,
184*e4b0a90eSBrooks Davis.Nm HMAC/RIPEMD160 ,
185*e4b0a90eSBrooks Davis.Nm HMAC/SHA256 ,
186*e4b0a90eSBrooks Davis.Nm HMAC/SHA384
187*e4b0a90eSBrooks Davisor
188*e4b0a90eSBrooks Davis.Nm HMAC/SHA512 .
189*e4b0a90eSBrooks Davis.It
190*e4b0a90eSBrooks DavisCan create a User Key from up to two, piecewise components: a passphrase
191*e4b0a90eSBrooks Davisentered via prompt or read from one or more passfiles; a keyfile read from
192*e4b0a90eSBrooks Davisone or more files.
193*e4b0a90eSBrooks Davis.It
194*e4b0a90eSBrooks DavisAllows encryption of the root partition.
195*e4b0a90eSBrooks DavisThe user will be asked for the
196*e4b0a90eSBrooks Davispassphrase before the root file system is mounted.
197*e4b0a90eSBrooks Davis.It
198*e4b0a90eSBrooks DavisStrengthens the passphrase component of the User Key with:
199*e4b0a90eSBrooks Davis.Rs
200*e4b0a90eSBrooks Davis.%A B. Kaliski
201*e4b0a90eSBrooks Davis.%T "PKCS #5: Password-Based Cryptography Specification, Version 2.0."
202*e4b0a90eSBrooks Davis.%R RFC
203*e4b0a90eSBrooks Davis.%N 2898
204*e4b0a90eSBrooks Davis.Re
205*e4b0a90eSBrooks Davis.It
206*e4b0a90eSBrooks DavisAllows the use of two independent User Keys (e.g., a
207*e4b0a90eSBrooks Davis.Qq "user key"
208*e4b0a90eSBrooks Davisand a
209*e4b0a90eSBrooks Davis.Qq "company key" ) .
210*e4b0a90eSBrooks Davis.It
211*e4b0a90eSBrooks DavisIt is fast -
212*e4b0a90eSBrooks Davis.Nm
213*e4b0a90eSBrooks Davisperforms simple sector-to-sector encryption.
214*e4b0a90eSBrooks Davis.It
215*e4b0a90eSBrooks DavisAllows the encrypted Master Key to be backed up and restored,
216*e4b0a90eSBrooks Davisso that if a user has to quickly destroy key material,
217*e4b0a90eSBrooks Davisit is possible to get the data back by restoring keys from
218*e4b0a90eSBrooks Davisbackup.
219*e4b0a90eSBrooks Davis.It
220*e4b0a90eSBrooks DavisProviders can be configured to automatically detach on last close
221*e4b0a90eSBrooks Davis(so users do not have to remember to detach providers after unmounting
222*e4b0a90eSBrooks Davisthe file systems).
223*e4b0a90eSBrooks Davis.It
224*e4b0a90eSBrooks DavisAllows attaching a provider with a random, one-time Master Key -
225*e4b0a90eSBrooks Davisuseful for swap partitions and temporary file systems.
226*e4b0a90eSBrooks Davis.It
227*e4b0a90eSBrooks DavisAllows verification of data integrity (data authentication).
228*e4b0a90eSBrooks Davis.It
229*e4b0a90eSBrooks DavisAllows suspending and resuming encrypted devices.
230*e4b0a90eSBrooks Davis.El
231*e4b0a90eSBrooks Davis.Pp
232*e4b0a90eSBrooks DavisThe first argument to
233*e4b0a90eSBrooks Davis.Nm
234*e4b0a90eSBrooks Davisindicates an action to be performed:
235*e4b0a90eSBrooks Davis.Bl -tag -width ".Cm configure"
236*e4b0a90eSBrooks Davis.It Cm init
237*e4b0a90eSBrooks DavisInitialize the provider which needs to be encrypted.
238*e4b0a90eSBrooks DavisHere you can set up the cryptographic algorithm to use, Data Key length,
239*e4b0a90eSBrooks Davisetc.
240*e4b0a90eSBrooks DavisThe last sector of the provider is used to store metadata.
241*e4b0a90eSBrooks DavisThe
242*e4b0a90eSBrooks Davis.Cm init
243*e4b0a90eSBrooks Davissubcommand also automatically writes metadata backups to
244*e4b0a90eSBrooks Davis.Pa /var/backups/<prov>.eli
245*e4b0a90eSBrooks Davisfile.
246*e4b0a90eSBrooks DavisThe metadata can be recovered with the
247*e4b0a90eSBrooks Davis.Cm restore
248*e4b0a90eSBrooks Davissubcommand described below.
249*e4b0a90eSBrooks Davis.Pp
250*e4b0a90eSBrooks DavisAdditional options include:
251*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl J Ar newpassfile"
252*e4b0a90eSBrooks Davis.It Fl a Ar aalgo
253*e4b0a90eSBrooks DavisEnable data integrity verification (authentication) using the given algorithm.
254*e4b0a90eSBrooks DavisThis will reduce the size of storage available and also reduce speed.
255*e4b0a90eSBrooks DavisFor example, when using 4096 bytes sector and
256*e4b0a90eSBrooks Davis.Nm HMAC/SHA256
257*e4b0a90eSBrooks Davisalgorithm, 89% of the original provider storage will be available for use.
258*e4b0a90eSBrooks DavisCurrently supported algorithms are:
259*e4b0a90eSBrooks Davis.Nm HMAC/MD5 ,
260*e4b0a90eSBrooks Davis.Nm HMAC/SHA1 ,
261*e4b0a90eSBrooks Davis.Nm HMAC/RIPEMD160 ,
262*e4b0a90eSBrooks Davis.Nm HMAC/SHA256 ,
263*e4b0a90eSBrooks Davis.Nm HMAC/SHA384
264*e4b0a90eSBrooks Davisand
265*e4b0a90eSBrooks Davis.Nm HMAC/SHA512 .
266*e4b0a90eSBrooks DavisIf the option is not given, there will be no authentication, only encryption.
267*e4b0a90eSBrooks DavisThe recommended algorithm is
268*e4b0a90eSBrooks Davis.Nm HMAC/SHA256 .
269*e4b0a90eSBrooks Davis.It Fl b
270*e4b0a90eSBrooks DavisTry to decrypt this partition during boot, before the root partition is mounted.
271*e4b0a90eSBrooks DavisThis makes it possible to use an encrypted root partition.
272*e4b0a90eSBrooks DavisOne will still need bootable unencrypted storage with a
273*e4b0a90eSBrooks Davis.Pa /boot/
274*e4b0a90eSBrooks Davisdirectory, which can be a CD-ROM disc or USB pen-drive, that can be removed
275*e4b0a90eSBrooks Davisafter boot.
276*e4b0a90eSBrooks Davis.It Fl B Ar backupfile
277*e4b0a90eSBrooks DavisFile name to use for metadata backup instead of the default
278*e4b0a90eSBrooks Davis.Pa /var/backups/<prov>.eli .
279*e4b0a90eSBrooks DavisTo inhibit backups, you can use
280*e4b0a90eSBrooks Davis.Pa none
281*e4b0a90eSBrooks Davisas the
282*e4b0a90eSBrooks Davis.Ar backupfile .
283*e4b0a90eSBrooks Davis.It Fl d
284*e4b0a90eSBrooks DavisWhen entering the passphrase to boot from this encrypted root filesystem, echo
285*e4b0a90eSBrooks Davis.Ql *
286*e4b0a90eSBrooks Davischaracters.
287*e4b0a90eSBrooks DavisThis makes the length of the passphrase visible.
288*e4b0a90eSBrooks Davis.It Fl e Ar ealgo
289*e4b0a90eSBrooks DavisEncryption algorithm to use.
290*e4b0a90eSBrooks DavisCurrently supported algorithms are:
291*e4b0a90eSBrooks Davis.Nm AES-XTS ,
292*e4b0a90eSBrooks Davis.Nm AES-CBC ,
293*e4b0a90eSBrooks Davis.Nm Blowfish-CBC ,
294*e4b0a90eSBrooks Davis.Nm Camellia-CBC ,
295*e4b0a90eSBrooks Davis.Nm 3DES-CBC ,
296*e4b0a90eSBrooks Davisand
297*e4b0a90eSBrooks Davis.Nm NULL .
298*e4b0a90eSBrooks DavisThe default and recommended algorithm is
299*e4b0a90eSBrooks Davis.Nm AES-XTS .
300*e4b0a90eSBrooks Davis.Nm NULL
301*e4b0a90eSBrooks Davisis unencrypted.
302*e4b0a90eSBrooks Davis.It Fl g
303*e4b0a90eSBrooks DavisEnable booting from this encrypted root filesystem.
304*e4b0a90eSBrooks DavisThe boot loader prompts for the passphrase and loads
305*e4b0a90eSBrooks Davis.Xr loader 8
306*e4b0a90eSBrooks Davisfrom the encrypted partition.
307*e4b0a90eSBrooks Davis.It Fl i Ar iterations
308*e4b0a90eSBrooks DavisNumber of iterations to use with PKCS#5v2 when processing User Key
309*e4b0a90eSBrooks Davispassphrase component.
310*e4b0a90eSBrooks DavisIf this option is not specified,
311*e4b0a90eSBrooks Davis.Nm
312*e4b0a90eSBrooks Daviswill find the number of iterations which is equal to 2 seconds of crypto work.
313*e4b0a90eSBrooks DavisIf 0 is given, PKCS#5v2 will not be used.
314*e4b0a90eSBrooks DavisPKCS#5v2 processing is performed once, after all parts of the passphrase
315*e4b0a90eSBrooks Daviscomponent have been read.
316*e4b0a90eSBrooks Davis.It Fl J Ar newpassfile
317*e4b0a90eSBrooks DavisSpecifies a file which contains the passphrase component of the User Key
318*e4b0a90eSBrooks Davis(or part of it).
319*e4b0a90eSBrooks DavisIf
320*e4b0a90eSBrooks Davis.Ar newpassfile
321*e4b0a90eSBrooks Davisis given as -, standard input will be used.
322*e4b0a90eSBrooks DavisOnly the first line (excluding new-line character) is taken from the given file.
323*e4b0a90eSBrooks DavisThis argument can be specified multiple times, which has the effect of
324*e4b0a90eSBrooks Davisreassembling a single passphrase split across multiple files.
325*e4b0a90eSBrooks DavisCannot be combined with the
326*e4b0a90eSBrooks Davis.Fl P
327*e4b0a90eSBrooks Davisoption.
328*e4b0a90eSBrooks Davis.It Fl K Ar newkeyfile
329*e4b0a90eSBrooks DavisSpecifies a file which contains the keyfile component of the User Key
330*e4b0a90eSBrooks Davis(or part of it).
331*e4b0a90eSBrooks DavisIf
332*e4b0a90eSBrooks Davis.Ar newkeyfile
333*e4b0a90eSBrooks Davisis given as -, standard input will be used.
334*e4b0a90eSBrooks DavisThis argument can be specified multiple times, which has the effect of
335*e4b0a90eSBrooks Davisreassembling a single keyfile split across multiple keyfile parts.
336*e4b0a90eSBrooks Davis.It Fl l Ar keylen
337*e4b0a90eSBrooks DavisData Key length to use with the given cryptographic algorithm.
338*e4b0a90eSBrooks DavisIf the length is not specified, the selected algorithm uses its
339*e4b0a90eSBrooks Davis.Em default
340*e4b0a90eSBrooks Daviskey length.
341*e4b0a90eSBrooks Davis.Bl -ohang -offset indent
342*e4b0a90eSBrooks Davis.It Nm AES-XTS
343*e4b0a90eSBrooks Davis.Em 128 ,
344*e4b0a90eSBrooks Davis256
345*e4b0a90eSBrooks Davis.It Nm AES-CBC , Nm Camellia-CBC
346*e4b0a90eSBrooks Davis.Em 128 ,
347*e4b0a90eSBrooks Davis192,
348*e4b0a90eSBrooks Davis256
349*e4b0a90eSBrooks Davis.It Nm Blowfish-CBC
350*e4b0a90eSBrooks Davis.Em 128
351*e4b0a90eSBrooks Davis+ n * 32, for n=[0..10]
352*e4b0a90eSBrooks Davis.It Nm 3DES-CBC
353*e4b0a90eSBrooks Davis.Em 192
354*e4b0a90eSBrooks Davis.El
355*e4b0a90eSBrooks Davis.It Fl P
356*e4b0a90eSBrooks DavisDo not use a passphrase as a component of the User Key.
357*e4b0a90eSBrooks DavisCannot be combined with the
358*e4b0a90eSBrooks Davis.Fl J
359*e4b0a90eSBrooks Davisoption.
360*e4b0a90eSBrooks Davis.It Fl s Ar sectorsize
361*e4b0a90eSBrooks DavisChange decrypted provider's sector size.
362*e4b0a90eSBrooks DavisIncreasing the sector size allows increased performance,
363*e4b0a90eSBrooks Davisbecause encryption/decryption which requires an initialization vector
364*e4b0a90eSBrooks Davisis done per sector; fewer sectors means less computational work.
365*e4b0a90eSBrooks Davis.It Fl T
366*e4b0a90eSBrooks DavisDon't pass through
367*e4b0a90eSBrooks Davis.Dv BIO_DELETE
368*e4b0a90eSBrooks Daviscalls (i.e., TRIM/UNMAP).
369*e4b0a90eSBrooks DavisThis can prevent an attacker from knowing how much space you're actually
370*e4b0a90eSBrooks Davisusing and which sectors contain live data, but will also prevent the
371*e4b0a90eSBrooks Davisbacking store (SSD, etc) from reclaiming space you're not using, which
372*e4b0a90eSBrooks Davismay degrade its performance and lifespan.
373*e4b0a90eSBrooks DavisThe underlying provider may or may not actually obliterate the deleted
374*e4b0a90eSBrooks Davissectors when TRIM is enabled, so it should not be considered to add any
375*e4b0a90eSBrooks Davissecurity.
376*e4b0a90eSBrooks Davis.It Fl V Ar version
377*e4b0a90eSBrooks DavisMetadata version to use.
378*e4b0a90eSBrooks DavisThis option is helpful when creating a provider that may be used by older
379*e4b0a90eSBrooks Davis.Nm FreeBSD/GELI
380*e4b0a90eSBrooks Davisversions.
381*e4b0a90eSBrooks DavisConsult the
382*e4b0a90eSBrooks Davis.Sx HISTORY
383*e4b0a90eSBrooks Davissection to find which metadata version is supported by which FreeBSD version.
384*e4b0a90eSBrooks DavisNote that using an older version of metadata may limit the number of
385*e4b0a90eSBrooks Davisfeatures available.
386*e4b0a90eSBrooks Davis.El
387*e4b0a90eSBrooks Davis.It Cm attach
388*e4b0a90eSBrooks DavisAttach the given provider.
389*e4b0a90eSBrooks DavisThe encrypted Master Key will be loaded from the metadata and decrypted
390*e4b0a90eSBrooks Davisusing the given passphrase/keyfile and a new GEOM provider will be created
391*e4b0a90eSBrooks Davisusing the given provider's name with an
392*e4b0a90eSBrooks Davis.Qq .eli
393*e4b0a90eSBrooks Davissuffix.
394*e4b0a90eSBrooks Davis.Pp
395*e4b0a90eSBrooks DavisAdditional options include:
396*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl j Ar passfile"
397*e4b0a90eSBrooks Davis.It Fl C
398*e4b0a90eSBrooks DavisDo a dry-run decryption.
399*e4b0a90eSBrooks DavisThis is useful to verify passphrase and keyfile without decrypting the device.
400*e4b0a90eSBrooks Davis.It Fl d
401*e4b0a90eSBrooks DavisIf specified, a decrypted provider will be detached automatically on last close.
402*e4b0a90eSBrooks DavisThis can help with scarce memory so the user does not have to remember to detach the
403*e4b0a90eSBrooks Davisprovider after unmounting the file system.
404*e4b0a90eSBrooks DavisIt only works when the provider was opened for writing, so it will not work if
405*e4b0a90eSBrooks Davisthe file system on the provider is mounted read-only.
406*e4b0a90eSBrooks DavisProbably a better choice is the
407*e4b0a90eSBrooks Davis.Fl l
408*e4b0a90eSBrooks Davisoption for the
409*e4b0a90eSBrooks Davis.Cm detach
410*e4b0a90eSBrooks Davissubcommand.
411*e4b0a90eSBrooks Davis.It Fl n Ar keyno
412*e4b0a90eSBrooks DavisSpecifies the index number of the Master Key copy to use (could be 0 or 1).
413*e4b0a90eSBrooks DavisIf the index number is not provided all keys will be tested.
414*e4b0a90eSBrooks Davis.It Fl j Ar passfile
415*e4b0a90eSBrooks DavisSpecifies a file which contains the passphrase component of the User Key
416*e4b0a90eSBrooks Davis(or part of it).
417*e4b0a90eSBrooks DavisFor more information see the description of the
418*e4b0a90eSBrooks Davis.Fl J
419*e4b0a90eSBrooks Davisoption for the
420*e4b0a90eSBrooks Davis.Cm init
421*e4b0a90eSBrooks Davissubcommand.
422*e4b0a90eSBrooks Davis.It Fl k Ar keyfile
423*e4b0a90eSBrooks DavisSpecifies a file which contains the keyfile component of the User Key
424*e4b0a90eSBrooks Davis(or part of it).
425*e4b0a90eSBrooks DavisFor more information see the description of the
426*e4b0a90eSBrooks Davis.Fl K
427*e4b0a90eSBrooks Davisoption for the
428*e4b0a90eSBrooks Davis.Cm init
429*e4b0a90eSBrooks Davissubcommand.
430*e4b0a90eSBrooks Davis.It Fl p
431*e4b0a90eSBrooks DavisDo not use a passphrase as a component of the User Key.
432*e4b0a90eSBrooks DavisCannot be combined with the
433*e4b0a90eSBrooks Davis.Fl j
434*e4b0a90eSBrooks Davisoption.
435*e4b0a90eSBrooks Davis.It Fl r
436*e4b0a90eSBrooks DavisAttach read-only provider.
437*e4b0a90eSBrooks DavisIt will not be opened for writing.
438*e4b0a90eSBrooks Davis.El
439*e4b0a90eSBrooks Davis.It Cm detach
440*e4b0a90eSBrooks DavisDetach the given providers, which means remove the devfs entry
441*e4b0a90eSBrooks Davisand clear the Master Key and Data Keys from memory.
442*e4b0a90eSBrooks Davis.Pp
443*e4b0a90eSBrooks DavisAdditional options include:
444*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl f"
445*e4b0a90eSBrooks Davis.It Fl f
446*e4b0a90eSBrooks DavisForce detach - detach even if the provider is open.
447*e4b0a90eSBrooks Davis.It Fl l
448*e4b0a90eSBrooks DavisMark provider to detach on last close.
449*e4b0a90eSBrooks DavisIf this option is specified, the provider will not be detached
450*e4b0a90eSBrooks Daviswhile it is open, but will be automatically detached when it is closed for the
451*e4b0a90eSBrooks Davislast time even if it was only opened for reading.
452*e4b0a90eSBrooks Davis.El
453*e4b0a90eSBrooks Davis.It Cm onetime
454*e4b0a90eSBrooks DavisAttach the given providers with a random, one-time (ephemeral) Master Key.
455*e4b0a90eSBrooks DavisThe command can be used to encrypt swap partitions or temporary file systems.
456*e4b0a90eSBrooks Davis.Pp
457*e4b0a90eSBrooks DavisAdditional options include:
458*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl a Ar sectorsize"
459*e4b0a90eSBrooks Davis.It Fl a Ar aalgo
460*e4b0a90eSBrooks DavisEnable data integrity verification (authentication).
461*e4b0a90eSBrooks DavisFor more information, see the description of the
462*e4b0a90eSBrooks Davis.Cm init
463*e4b0a90eSBrooks Davissubcommand.
464*e4b0a90eSBrooks Davis.It Fl e Ar ealgo
465*e4b0a90eSBrooks DavisEncryption algorithm to use.
466*e4b0a90eSBrooks DavisFor more information, see the description of the
467*e4b0a90eSBrooks Davis.Cm init
468*e4b0a90eSBrooks Davissubcommand.
469*e4b0a90eSBrooks Davis.It Fl d
470*e4b0a90eSBrooks DavisDetach on last close.
471*e4b0a90eSBrooks DavisNote: this option is not usable for temporary file systems as the provider will
472*e4b0a90eSBrooks Davisbe detached after creating the file system on it.
473*e4b0a90eSBrooks DavisIt still can (and should be) used for swap partitions.
474*e4b0a90eSBrooks DavisFor more information, see the description of the
475*e4b0a90eSBrooks Davis.Cm attach
476*e4b0a90eSBrooks Davissubcommand.
477*e4b0a90eSBrooks Davis.It Fl l Ar keylen
478*e4b0a90eSBrooks DavisData Key length to use with the given cryptographic algorithm.
479*e4b0a90eSBrooks DavisFor more information, see the description of the
480*e4b0a90eSBrooks Davis.Cm init
481*e4b0a90eSBrooks Davissubcommand.
482*e4b0a90eSBrooks Davis.It Fl s Ar sectorsize
483*e4b0a90eSBrooks DavisChange decrypted provider's sector size.
484*e4b0a90eSBrooks DavisFor more information, see the description of the
485*e4b0a90eSBrooks Davis.Cm init
486*e4b0a90eSBrooks Davissubcommand.
487*e4b0a90eSBrooks Davis.It Fl T
488*e4b0a90eSBrooks DavisDisable TRIM/UNMAP passthru.
489*e4b0a90eSBrooks DavisFor more information, see the description of the
490*e4b0a90eSBrooks Davis.Cm init
491*e4b0a90eSBrooks Davissubcommand.
492*e4b0a90eSBrooks Davis.El
493*e4b0a90eSBrooks Davis.It Cm configure
494*e4b0a90eSBrooks DavisChange configuration of the given providers.
495*e4b0a90eSBrooks Davis.Pp
496*e4b0a90eSBrooks DavisAdditional options include:
497*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl b"
498*e4b0a90eSBrooks Davis.It Fl b
499*e4b0a90eSBrooks DavisSet the BOOT flag on the given providers.
500*e4b0a90eSBrooks DavisFor more information, see the description of the
501*e4b0a90eSBrooks Davis.Cm init
502*e4b0a90eSBrooks Davissubcommand.
503*e4b0a90eSBrooks Davis.It Fl B
504*e4b0a90eSBrooks DavisRemove the BOOT flag from the given providers.
505*e4b0a90eSBrooks Davis.It Fl d
506*e4b0a90eSBrooks DavisWhen entering the passphrase to boot from this encrypted root filesystem, echo
507*e4b0a90eSBrooks Davis.Ql *
508*e4b0a90eSBrooks Davischaracters.
509*e4b0a90eSBrooks DavisThis makes the length of the passphrase visible.
510*e4b0a90eSBrooks Davis.It Fl D
511*e4b0a90eSBrooks DavisDisable echoing of any characters when a passphrase is entered to boot from this
512*e4b0a90eSBrooks Davisencrypted root filesystem.
513*e4b0a90eSBrooks DavisThis hides the passphrase length.
514*e4b0a90eSBrooks Davis.It Fl g
515*e4b0a90eSBrooks DavisEnable booting from this encrypted root filesystem.
516*e4b0a90eSBrooks DavisThe boot loader prompts for the passphrase and loads
517*e4b0a90eSBrooks Davis.Xr loader 8
518*e4b0a90eSBrooks Davisfrom the encrypted partition.
519*e4b0a90eSBrooks Davis.It Fl G
520*e4b0a90eSBrooks DavisDeactivate booting from this encrypted root partition.
521*e4b0a90eSBrooks Davis.It Fl t
522*e4b0a90eSBrooks DavisEnable TRIM/UNMAP passthru.
523*e4b0a90eSBrooks DavisFor more information, see the description of the
524*e4b0a90eSBrooks Davis.Cm init
525*e4b0a90eSBrooks Davissubcommand.
526*e4b0a90eSBrooks Davis.It Fl T
527*e4b0a90eSBrooks DavisDisable TRIM/UNMAP passthru.
528*e4b0a90eSBrooks Davis.El
529*e4b0a90eSBrooks Davis.It Cm setkey
530*e4b0a90eSBrooks DavisInstall a copy of the Master Key into the selected slot, encrypted with
531*e4b0a90eSBrooks Davisa new User Key.
532*e4b0a90eSBrooks DavisIf the selected slot is populated, replace the existing copy.
533*e4b0a90eSBrooks DavisA provider has one Master Key, which can be stored in one or both slots,
534*e4b0a90eSBrooks Daviseach encrypted with an independent User Key.
535*e4b0a90eSBrooks DavisWith the
536*e4b0a90eSBrooks Davis.Cm init
537*e4b0a90eSBrooks Davissubcommand, only key number 0 is initialized.
538*e4b0a90eSBrooks DavisThe User Key can be changed at any time: for an attached provider,
539*e4b0a90eSBrooks Davisfor a detached provider, or on the backup file.
540*e4b0a90eSBrooks DavisWhen a provider is attached, the user does not have to provide
541*e4b0a90eSBrooks Davisan existing passphrase/keyfile.
542*e4b0a90eSBrooks Davis.Pp
543*e4b0a90eSBrooks DavisAdditional options include:
544*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl J Ar newpassfile"
545*e4b0a90eSBrooks Davis.It Fl i Ar iterations
546*e4b0a90eSBrooks DavisNumber of iterations to use with PKCS#5v2.
547*e4b0a90eSBrooks DavisIf 0 is given, PKCS#5v2 will not be used.
548*e4b0a90eSBrooks DavisTo be able to use this option with the
549*e4b0a90eSBrooks Davis.Cm setkey
550*e4b0a90eSBrooks Davissubcommand, only one key has to be defined and this key must be changed.
551*e4b0a90eSBrooks Davis.It Fl j Ar passfile
552*e4b0a90eSBrooks DavisSpecifies a file which contains the passphrase component of a current User Key
553*e4b0a90eSBrooks Davis(or part of it).
554*e4b0a90eSBrooks Davis.It Fl J Ar newpassfile
555*e4b0a90eSBrooks DavisSpecifies a file which contains the passphrase component of the new User Key
556*e4b0a90eSBrooks Davis(or part of it).
557*e4b0a90eSBrooks Davis.It Fl k Ar keyfile
558*e4b0a90eSBrooks DavisSpecifies a file which contains the keyfile component of a current User Key
559*e4b0a90eSBrooks Davis(or part of it).
560*e4b0a90eSBrooks Davis.It Fl K Ar newkeyfile
561*e4b0a90eSBrooks DavisSpecifies a file which contains the keyfile component of the new User Key
562*e4b0a90eSBrooks Davis(or part of it).
563*e4b0a90eSBrooks Davis.It Fl n Ar keyno
564*e4b0a90eSBrooks DavisSpecifies the index number of the Master Key copy to change (could be 0 or 1).
565*e4b0a90eSBrooks DavisIf the provider is attached and no key number is given, the key
566*e4b0a90eSBrooks Davisused for attaching the provider will be changed.
567*e4b0a90eSBrooks DavisIf the provider is detached (or we are operating on a backup file)
568*e4b0a90eSBrooks Davisand no key number is given, the first Master Key copy to be successfully
569*e4b0a90eSBrooks Davisdecrypted with the provided User Key passphrase/keyfile will be changed.
570*e4b0a90eSBrooks Davis.It Fl p
571*e4b0a90eSBrooks DavisDo not use a passphrase as a component of the current User Key.
572*e4b0a90eSBrooks DavisCannot be combined with the
573*e4b0a90eSBrooks Davis.Fl j
574*e4b0a90eSBrooks Davisoption.
575*e4b0a90eSBrooks Davis.It Fl P
576*e4b0a90eSBrooks DavisDo not use a passphrase as a component of the new User Key.
577*e4b0a90eSBrooks DavisCannot be combined with the
578*e4b0a90eSBrooks Davis.Fl J
579*e4b0a90eSBrooks Davisoption.
580*e4b0a90eSBrooks Davis.El
581*e4b0a90eSBrooks Davis.It Cm delkey
582*e4b0a90eSBrooks DavisDestroy (overwrite with random data) the selected Master Key copy.
583*e4b0a90eSBrooks DavisIf one is destroying keys for an attached provider, the provider
584*e4b0a90eSBrooks Daviswill not be detached even if all copies of the Master Key are destroyed.
585*e4b0a90eSBrooks DavisIt can even be rescued with the
586*e4b0a90eSBrooks Davis.Cm setkey
587*e4b0a90eSBrooks Davissubcommand because the Master Key is still in memory.
588*e4b0a90eSBrooks Davis.Pp
589*e4b0a90eSBrooks DavisAdditional options include:
590*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl a Ar keyno"
591*e4b0a90eSBrooks Davis.It Fl a
592*e4b0a90eSBrooks DavisDestroy all copies of the Master Key (does not need
593*e4b0a90eSBrooks Davis.Fl f
594*e4b0a90eSBrooks Davisoption).
595*e4b0a90eSBrooks Davis.It Fl f
596*e4b0a90eSBrooks DavisForce key destruction.
597*e4b0a90eSBrooks DavisThis option is needed to destroy the last copy of the Master Key.
598*e4b0a90eSBrooks Davis.It Fl n Ar keyno
599*e4b0a90eSBrooks DavisSpecifies the index number of the Master Key copy.
600*e4b0a90eSBrooks DavisIf the provider is attached and no key number is given, the key
601*e4b0a90eSBrooks Davisused for attaching the provider will be destroyed.
602*e4b0a90eSBrooks DavisIf provider is detached (or we are operating on a backup file) the key number
603*e4b0a90eSBrooks Davishas to be given.
604*e4b0a90eSBrooks Davis.El
605*e4b0a90eSBrooks Davis.It Cm kill
606*e4b0a90eSBrooks DavisThis command should be used only in emergency situations.
607*e4b0a90eSBrooks DavisIt will destroy all copies of the Master Key on a given provider and will
608*e4b0a90eSBrooks Davisdetach it forcibly (if it is attached).
609*e4b0a90eSBrooks DavisThis is absolutely a one-way command - if you do not have a metadata
610*e4b0a90eSBrooks Davisbackup, your data is gone for good.
611*e4b0a90eSBrooks DavisIn case the provider was attached with the
612*e4b0a90eSBrooks Davis.Fl r
613*e4b0a90eSBrooks Davisflag, the keys will not be destroyed, only the provider will be detached.
614*e4b0a90eSBrooks Davis.Pp
615*e4b0a90eSBrooks DavisAdditional options include:
616*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl a"
617*e4b0a90eSBrooks Davis.It Fl a
618*e4b0a90eSBrooks DavisIf specified, all currently attached providers will be killed.
619*e4b0a90eSBrooks Davis.El
620*e4b0a90eSBrooks Davis.It Cm backup
621*e4b0a90eSBrooks DavisBackup metadata from the given provider to the given file.
622*e4b0a90eSBrooks Davis.It Cm restore
623*e4b0a90eSBrooks DavisRestore metadata from the given file to the given provider.
624*e4b0a90eSBrooks Davis.Pp
625*e4b0a90eSBrooks DavisAdditional options include:
626*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl f"
627*e4b0a90eSBrooks Davis.It Fl f
628*e4b0a90eSBrooks DavisMetadata contains the size of the provider to ensure that the correct
629*e4b0a90eSBrooks Davispartition or slice is attached.
630*e4b0a90eSBrooks DavisIf an attempt is made to restore metadata to a provider that has a different
631*e4b0a90eSBrooks Davissize,
632*e4b0a90eSBrooks Davis.Nm
633*e4b0a90eSBrooks Daviswill refuse to restore the data unless the
634*e4b0a90eSBrooks Davis.Fl f
635*e4b0a90eSBrooks Davisswitch is used.
636*e4b0a90eSBrooks DavisIf the partition or slice has been grown, the
637*e4b0a90eSBrooks Davis.Cm resize
638*e4b0a90eSBrooks Davissubcommand should be used rather than attempting to relocate the metadata
639*e4b0a90eSBrooks Davisthrough
640*e4b0a90eSBrooks Davis.Cm backup
641*e4b0a90eSBrooks Davisand
642*e4b0a90eSBrooks Davis.Cm restore .
643*e4b0a90eSBrooks Davis.El
644*e4b0a90eSBrooks Davis.It Cm suspend
645*e4b0a90eSBrooks DavisSuspend device by waiting for all inflight requests to finish, clearing all
646*e4b0a90eSBrooks Davissensitive information (like the Master Key and Data Keys) from kernel memory,
647*e4b0a90eSBrooks Davisand blocking all further I/O requests until the
648*e4b0a90eSBrooks Davis.Cm resume
649*e4b0a90eSBrooks Davissubcommand is executed.
650*e4b0a90eSBrooks DavisThis functionality is useful for laptops: when one wants to suspend a
651*e4b0a90eSBrooks Davislaptop, one does not want to leave an encrypted device attached.
652*e4b0a90eSBrooks DavisInstead of closing all files and directories opened from a file system located
653*e4b0a90eSBrooks Davison an encrypted device, unmounting the file system, and detaching the device,
654*e4b0a90eSBrooks Davisthe
655*e4b0a90eSBrooks Davis.Cm suspend
656*e4b0a90eSBrooks Davissubcommand can be used.
657*e4b0a90eSBrooks DavisAny access to the encrypted device will be blocked until the Master Key is
658*e4b0a90eSBrooks Davisreloaded through the
659*e4b0a90eSBrooks Davis.Cm resume
660*e4b0a90eSBrooks Davissubcommand.
661*e4b0a90eSBrooks DavisThus there is no need to close nor unmount anything.
662*e4b0a90eSBrooks DavisThe
663*e4b0a90eSBrooks Davis.Cm suspend
664*e4b0a90eSBrooks Davissubcommand does not work with devices created with the
665*e4b0a90eSBrooks Davis.Cm onetime
666*e4b0a90eSBrooks Davissubcommand.
667*e4b0a90eSBrooks DavisPlease note that sensitive data might still be present in memory after
668*e4b0a90eSBrooks Davissuspending an encrypted device due to the file system cache, etc.
669*e4b0a90eSBrooks Davis.Pp
670*e4b0a90eSBrooks DavisAdditional options include:
671*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl a"
672*e4b0a90eSBrooks Davis.It Fl a
673*e4b0a90eSBrooks DavisSuspend all
674*e4b0a90eSBrooks Davis.Nm
675*e4b0a90eSBrooks Davisdevices.
676*e4b0a90eSBrooks Davis.El
677*e4b0a90eSBrooks Davis.It Cm resume
678*e4b0a90eSBrooks DavisResume previously suspended device.
679*e4b0a90eSBrooks DavisThe caller must ensure that executing this subcommand does not access the
680*e4b0a90eSBrooks Davissuspended device, leading to a deadlock.
681*e4b0a90eSBrooks DavisFor example suspending a device which contains the file system where the
682*e4b0a90eSBrooks Davis.Nm
683*e4b0a90eSBrooks Davisutility is stored is bad idea.
684*e4b0a90eSBrooks Davis.Pp
685*e4b0a90eSBrooks DavisAdditional options include:
686*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl j Ar passfile"
687*e4b0a90eSBrooks Davis.It Fl j Ar passfile
688*e4b0a90eSBrooks DavisSpecifies a file which contains the passphrase component of the User Key
689*e4b0a90eSBrooks Davis(or part of it).
690*e4b0a90eSBrooks DavisFor more information see the description of the
691*e4b0a90eSBrooks Davis.Fl J
692*e4b0a90eSBrooks Davisoption for the
693*e4b0a90eSBrooks Davis.Cm init
694*e4b0a90eSBrooks Davissubcommand.
695*e4b0a90eSBrooks Davis.It Fl k Ar keyfile
696*e4b0a90eSBrooks DavisSpecifies a file which contains the keyfile component of the User Key
697*e4b0a90eSBrooks Davis(or part of it).
698*e4b0a90eSBrooks DavisFor more information see the description of the
699*e4b0a90eSBrooks Davis.Fl K
700*e4b0a90eSBrooks Davisoption for the
701*e4b0a90eSBrooks Davis.Cm init
702*e4b0a90eSBrooks Davissubcommand.
703*e4b0a90eSBrooks Davis.It Fl p
704*e4b0a90eSBrooks DavisDo not use a passphrase as a component of the User Key.
705*e4b0a90eSBrooks DavisCannot be combined with the
706*e4b0a90eSBrooks Davis.Fl j
707*e4b0a90eSBrooks Davisoption.
708*e4b0a90eSBrooks Davis.El
709*e4b0a90eSBrooks Davis.It Cm resize
710*e4b0a90eSBrooks DavisInform
711*e4b0a90eSBrooks Davis.Nm
712*e4b0a90eSBrooks Davisthat the provider has been resized.
713*e4b0a90eSBrooks DavisThe old metadata block is relocated to the correct position at the end of the
714*e4b0a90eSBrooks Davisprovider and the provider size is updated.
715*e4b0a90eSBrooks Davis.Pp
716*e4b0a90eSBrooks DavisAdditional options include:
717*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl s Ar oldsize"
718*e4b0a90eSBrooks Davis.It Fl s Ar oldsize
719*e4b0a90eSBrooks DavisThe size of the provider before it was resized.
720*e4b0a90eSBrooks Davis.El
721*e4b0a90eSBrooks Davis.It Cm version
722*e4b0a90eSBrooks DavisIf no arguments are given, the
723*e4b0a90eSBrooks Davis.Cm version
724*e4b0a90eSBrooks Davissubcommand will print the version of
725*e4b0a90eSBrooks Davis.Nm
726*e4b0a90eSBrooks Davisuserland utility as well as the version of the
727*e4b0a90eSBrooks Davis.Nm ELI
728*e4b0a90eSBrooks DavisGEOM class.
729*e4b0a90eSBrooks Davis.Pp
730*e4b0a90eSBrooks DavisIf GEOM providers are specified, the
731*e4b0a90eSBrooks Davis.Cm version
732*e4b0a90eSBrooks Davissubcommand will print metadata version used by each of them.
733*e4b0a90eSBrooks Davis.It Cm clear
734*e4b0a90eSBrooks DavisClear metadata from the given providers.
735*e4b0a90eSBrooks Davis.Em WARNING :
736*e4b0a90eSBrooks DavisThis will erase with zeros the encrypted Master Key copies stored in the
737*e4b0a90eSBrooks Davismetadata.
738*e4b0a90eSBrooks Davis.It Cm dump
739*e4b0a90eSBrooks DavisDump metadata stored on the given providers.
740*e4b0a90eSBrooks Davis.It Cm list
741*e4b0a90eSBrooks DavisSee
742*e4b0a90eSBrooks Davis.Xr geom 8 .
743*e4b0a90eSBrooks Davis.It Cm status
744*e4b0a90eSBrooks DavisSee
745*e4b0a90eSBrooks Davis.Xr geom 8 .
746*e4b0a90eSBrooks Davis.It Cm load
747*e4b0a90eSBrooks DavisSee
748*e4b0a90eSBrooks Davis.Xr geom 8 .
749*e4b0a90eSBrooks Davis.It Cm unload
750*e4b0a90eSBrooks DavisSee
751*e4b0a90eSBrooks Davis.Xr geom 8 .
752*e4b0a90eSBrooks Davis.El
753*e4b0a90eSBrooks Davis.Pp
754*e4b0a90eSBrooks DavisAdditional options include:
755*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl v"
756*e4b0a90eSBrooks Davis.It Fl v
757*e4b0a90eSBrooks DavisBe more verbose.
758*e4b0a90eSBrooks Davis.El
759*e4b0a90eSBrooks Davis.Sh KEY SUMMARY
760*e4b0a90eSBrooks Davis.Ss Master Key
761*e4b0a90eSBrooks DavisUpon
762*e4b0a90eSBrooks Davis.Cm init ,
763*e4b0a90eSBrooks Davisthe
764*e4b0a90eSBrooks Davis.Nm
765*e4b0a90eSBrooks Davisutility generates a random Master Key for the provider.
766*e4b0a90eSBrooks DavisThe Master Key never changes during the lifetime of the provider.
767*e4b0a90eSBrooks DavisEach copy of the provider metadata, active or backed up to a file, can store
768*e4b0a90eSBrooks Davisup to two, independently-encrypted copies of the Master Key.
769*e4b0a90eSBrooks Davis.Ss User Key
770*e4b0a90eSBrooks DavisEach stored copy of the Master Key is encrypted with a User Key, which
771*e4b0a90eSBrooks Davisis generated by the
772*e4b0a90eSBrooks Davis.Nm
773*e4b0a90eSBrooks Davisutility from a passphrase and/or a keyfile.
774*e4b0a90eSBrooks DavisThe
775*e4b0a90eSBrooks Davis.Nm
776*e4b0a90eSBrooks Davisutility first reads all parts of the keyfile in the order specified on the
777*e4b0a90eSBrooks Daviscommand line, then reads all parts of the stored passphrase in the order
778*e4b0a90eSBrooks Davisspecified on the command line.
779*e4b0a90eSBrooks DavisIf no passphrase parts are specified, the system prompts the user to enter
780*e4b0a90eSBrooks Davisthe passphrase.
781*e4b0a90eSBrooks DavisThe passphrase is optionally strengthened by PKCS#5v2.
782*e4b0a90eSBrooks DavisThe User Key is a digest computed over the concatenated keyfile and passphrase.
783*e4b0a90eSBrooks Davis.Ss Data Key
784*e4b0a90eSBrooks DavisDuring operation, one or more Data Keys are deterministically derived by
785*e4b0a90eSBrooks Davisthe kernel from the Master Key and cached in memory.
786*e4b0a90eSBrooks DavisThe number of Data Keys used by a given provider, and the way they are
787*e4b0a90eSBrooks Davisderived, depend on the GELI version and whether the provider is configured to
788*e4b0a90eSBrooks Davisuse data authentication.
789*e4b0a90eSBrooks Davis.Sh SYSCTL VARIABLES
790*e4b0a90eSBrooks DavisThe following
791*e4b0a90eSBrooks Davis.Xr sysctl 8
792*e4b0a90eSBrooks Davisvariables can be used to control the behavior of the
793*e4b0a90eSBrooks Davis.Nm ELI
794*e4b0a90eSBrooks DavisGEOM class.
795*e4b0a90eSBrooks DavisThe default value is shown next to each variable.
796*e4b0a90eSBrooks DavisSome variables can also be set in
797*e4b0a90eSBrooks Davis.Pa /boot/loader.conf .
798*e4b0a90eSBrooks Davis.Bl -tag -width indent
799*e4b0a90eSBrooks Davis.It Va kern.geom.eli.version
800*e4b0a90eSBrooks DavisVersion number of the
801*e4b0a90eSBrooks Davis.Nm ELI
802*e4b0a90eSBrooks DavisGEOM class.
803*e4b0a90eSBrooks Davis.It Va kern.geom.eli.debug : No 0
804*e4b0a90eSBrooks DavisDebug level of the
805*e4b0a90eSBrooks Davis.Nm ELI
806*e4b0a90eSBrooks DavisGEOM class.
807*e4b0a90eSBrooks DavisThis can be set to a number between 0 and 3 inclusive.
808*e4b0a90eSBrooks DavisIf set to 0, minimal debug information is printed.
809*e4b0a90eSBrooks DavisIf set to 3, the
810*e4b0a90eSBrooks Davismaximum amount of debug information is printed.
811*e4b0a90eSBrooks Davis.It Va kern.geom.eli.tries : No 3
812*e4b0a90eSBrooks DavisNumber of times a user is asked for the passphrase.
813*e4b0a90eSBrooks DavisThis is only used for providers which are attached on boot
814*e4b0a90eSBrooks Davis(before the root file system is mounted).
815*e4b0a90eSBrooks DavisIf set to 0, attaching providers on boot will be disabled.
816*e4b0a90eSBrooks DavisThis variable should be set in
817*e4b0a90eSBrooks Davis.Pa /boot/loader.conf .
818*e4b0a90eSBrooks Davis.It Va kern.geom.eli.overwrites : No 5
819*e4b0a90eSBrooks DavisSpecifies how many times the Master Key will be overwritten
820*e4b0a90eSBrooks Daviswith random values when it is destroyed.
821*e4b0a90eSBrooks DavisAfter this operation it is filled with zeros.
822*e4b0a90eSBrooks Davis.It Va kern.geom.eli.visible_passphrase : No 0
823*e4b0a90eSBrooks DavisIf set to 1, the passphrase entered on boot (before the root
824*e4b0a90eSBrooks Davisfile system is mounted) will be visible.
825*e4b0a90eSBrooks DavisThis alternative should be used with caution as the entered
826*e4b0a90eSBrooks Davispassphrase can be logged and exposed via
827*e4b0a90eSBrooks Davis.Xr dmesg 8 .
828*e4b0a90eSBrooks DavisThis variable should be set in
829*e4b0a90eSBrooks Davis.Pa /boot/loader.conf .
830*e4b0a90eSBrooks Davis.It Va kern.geom.eli.threads : No 0
831*e4b0a90eSBrooks DavisSpecifies how many kernel threads should be used for doing software
832*e4b0a90eSBrooks Daviscryptography.
833*e4b0a90eSBrooks DavisIts purpose is to increase performance on SMP systems.
834*e4b0a90eSBrooks DavisIf set to 0, a CPU-pinned thread will be started for every active CPU.
835*e4b0a90eSBrooks Davis.It Va kern.geom.eli.batch : No 0
836*e4b0a90eSBrooks DavisWhen set to 1, can speed-up crypto operations by using batching.
837*e4b0a90eSBrooks DavisBatching reduces the number of interrupts by responding to a group of
838*e4b0a90eSBrooks Daviscrypto requests with one interrupt.
839*e4b0a90eSBrooks DavisThe crypto card and the driver has to support this feature.
840*e4b0a90eSBrooks Davis.It Va kern.geom.eli.key_cache_limit : No 8192
841*e4b0a90eSBrooks DavisSpecifies how many Data Keys to cache.
842*e4b0a90eSBrooks DavisThe default limit
843*e4b0a90eSBrooks Davis(8192 keys) will allow caching of all keys for a 4TB provider with 512 byte
844*e4b0a90eSBrooks Davissectors and will take around 1MB of memory.
845*e4b0a90eSBrooks Davis.It Va kern.geom.eli.key_cache_hits
846*e4b0a90eSBrooks DavisReports how many times we were looking up a Data Key and it was already in
847*e4b0a90eSBrooks Daviscache.
848*e4b0a90eSBrooks DavisThis sysctl is not updated for providers that need fewer Data Keys than
849*e4b0a90eSBrooks Davisthe limit specified in
850*e4b0a90eSBrooks Davis.Va kern.geom.eli.key_cache_limit .
851*e4b0a90eSBrooks Davis.It Va kern.geom.eli.key_cache_misses
852*e4b0a90eSBrooks DavisReports how many times we were looking up a Data Key and it was not in cache.
853*e4b0a90eSBrooks DavisThis sysctl is not updated for providers that need fewer Data Keys than the limit
854*e4b0a90eSBrooks Davisspecified in
855*e4b0a90eSBrooks Davis.Va kern.geom.eli.key_cache_limit .
856*e4b0a90eSBrooks Davis.El
857*e4b0a90eSBrooks Davis.Sh EXIT STATUS
858*e4b0a90eSBrooks DavisExit status is 0 on success, and 1 if the command fails.
859*e4b0a90eSBrooks Davis.Sh EXAMPLES
860*e4b0a90eSBrooks DavisInitialize a provider which is going to be encrypted with a
861*e4b0a90eSBrooks Davispassphrase and random data from a file on the user's pen drive.
862*e4b0a90eSBrooks DavisUse 4kB sector size.
863*e4b0a90eSBrooks DavisAttach the provider, create a file system, and mount it.
864*e4b0a90eSBrooks DavisDo the work.
865*e4b0a90eSBrooks DavisUnmount the provider and detach it:
866*e4b0a90eSBrooks Davis.Bd -literal -offset indent
867*e4b0a90eSBrooks Davis# dd if=/dev/random of=/mnt/pendrive/da2.key bs=64 count=1
868*e4b0a90eSBrooks Davis# geli init -s 4096 -K /mnt/pendrive/da2.key /dev/da2
869*e4b0a90eSBrooks DavisEnter new passphrase:
870*e4b0a90eSBrooks DavisReenter new passphrase:
871*e4b0a90eSBrooks Davis# geli attach -k /mnt/pendrive/da2.key /dev/da2
872*e4b0a90eSBrooks DavisEnter passphrase:
873*e4b0a90eSBrooks Davis# dd if=/dev/random of=/dev/da2.eli bs=1m
874*e4b0a90eSBrooks Davis# newfs /dev/da2.eli
875*e4b0a90eSBrooks Davis# mount /dev/da2.eli /mnt/secret
876*e4b0a90eSBrooks Davis\&...
877*e4b0a90eSBrooks Davis# umount /mnt/secret
878*e4b0a90eSBrooks Davis# geli detach da2.eli
879*e4b0a90eSBrooks Davis.Ed
880*e4b0a90eSBrooks Davis.Pp
881*e4b0a90eSBrooks DavisCreate an encrypted provider, but use two User Keys:
882*e4b0a90eSBrooks Davisone for your employee and one for you as the company's security officer
883*e4b0a90eSBrooks Davis(so it is not a tragedy if the employee
884*e4b0a90eSBrooks Davis.Qq accidentally
885*e4b0a90eSBrooks Davisforgets his passphrase):
886*e4b0a90eSBrooks Davis.Bd -literal -offset indent
887*e4b0a90eSBrooks Davis# geli init /dev/da2
888*e4b0a90eSBrooks DavisEnter new passphrase:	(enter security officer's passphrase)
889*e4b0a90eSBrooks DavisReenter new passphrase:
890*e4b0a90eSBrooks Davis# geli setkey -n 1 /dev/da2
891*e4b0a90eSBrooks DavisEnter passphrase:	(enter security officer's passphrase)
892*e4b0a90eSBrooks DavisEnter new passphrase:	(let your employee enter his passphrase ...)
893*e4b0a90eSBrooks DavisReenter new passphrase:	(... twice)
894*e4b0a90eSBrooks Davis.Ed
895*e4b0a90eSBrooks Davis.Pp
896*e4b0a90eSBrooks DavisYou are the security officer in your company.
897*e4b0a90eSBrooks DavisCreate an encrypted provider for use by the user, but remember that users
898*e4b0a90eSBrooks Davisforget their passphrases, so backup the Master Key with your own random key:
899*e4b0a90eSBrooks Davis.Bd -literal -offset indent
900*e4b0a90eSBrooks Davis# dd if=/dev/random of=/mnt/pendrive/keys/`hostname` bs=64 count=1
901*e4b0a90eSBrooks Davis# geli init -P -K /mnt/pendrive/keys/`hostname` /dev/ada0s1e
902*e4b0a90eSBrooks Davis# geli backup /dev/ada0s1e /mnt/pendrive/backups/`hostname`
903*e4b0a90eSBrooks Davis(use key number 0, so the encrypted Master Key will be re-encrypted by this)
904*e4b0a90eSBrooks Davis# geli setkey -n 0 -k /mnt/pendrive/keys/`hostname` /dev/ada0s1e
905*e4b0a90eSBrooks Davis(allow the user to enter his passphrase)
906*e4b0a90eSBrooks DavisEnter new passphrase:
907*e4b0a90eSBrooks DavisReenter new passphrase:
908*e4b0a90eSBrooks Davis.Ed
909*e4b0a90eSBrooks Davis.Pp
910*e4b0a90eSBrooks DavisEncrypted swap partition setup:
911*e4b0a90eSBrooks Davis.Bd -literal -offset indent
912*e4b0a90eSBrooks Davis# dd if=/dev/random of=/dev/ada0s1b bs=1m
913*e4b0a90eSBrooks Davis# geli onetime -d -e 3des ada0s1b
914*e4b0a90eSBrooks Davis# swapon /dev/ada0s1b.eli
915*e4b0a90eSBrooks Davis.Ed
916*e4b0a90eSBrooks Davis.Pp
917*e4b0a90eSBrooks DavisThe example below shows how to configure two providers which will be attached
918*e4b0a90eSBrooks Davison boot (before the root file system is mounted).
919*e4b0a90eSBrooks DavisOne of them is using passphrase and three keyfile parts and the other is
920*e4b0a90eSBrooks Davisusing only a keyfile in one part:
921*e4b0a90eSBrooks Davis.Bd -literal -offset indent
922*e4b0a90eSBrooks Davis# dd if=/dev/random of=/dev/da0 bs=1m
923*e4b0a90eSBrooks Davis# dd if=/dev/random of=/boot/keys/da0.key0 bs=32k count=1
924*e4b0a90eSBrooks Davis# dd if=/dev/random of=/boot/keys/da0.key1 bs=32k count=1
925*e4b0a90eSBrooks Davis# dd if=/dev/random of=/boot/keys/da0.key2 bs=32k count=1
926*e4b0a90eSBrooks Davis# geli init -b -K /boot/keys/da0.key0 -K /boot/keys/da0.key1 -K /boot/keys/da0.key2 da0
927*e4b0a90eSBrooks DavisEnter new passphrase:
928*e4b0a90eSBrooks DavisReenter new passphrase:
929*e4b0a90eSBrooks Davis# dd if=/dev/random of=/dev/da1s3a bs=1m
930*e4b0a90eSBrooks Davis# dd if=/dev/random of=/boot/keys/da1s3a.key bs=128k count=1
931*e4b0a90eSBrooks Davis# geli init -b -P -K /boot/keys/da1s3a.key da1s3a
932*e4b0a90eSBrooks Davis.Ed
933*e4b0a90eSBrooks Davis.Pp
934*e4b0a90eSBrooks DavisThe providers are initialized, now we have to add these lines to
935*e4b0a90eSBrooks Davis.Pa /boot/loader.conf :
936*e4b0a90eSBrooks Davis.Bd -literal -offset indent
937*e4b0a90eSBrooks Davisgeli_da0_keyfile0_load="YES"
938*e4b0a90eSBrooks Davisgeli_da0_keyfile0_type="da0:geli_keyfile0"
939*e4b0a90eSBrooks Davisgeli_da0_keyfile0_name="/boot/keys/da0.key0"
940*e4b0a90eSBrooks Davisgeli_da0_keyfile1_load="YES"
941*e4b0a90eSBrooks Davisgeli_da0_keyfile1_type="da0:geli_keyfile1"
942*e4b0a90eSBrooks Davisgeli_da0_keyfile1_name="/boot/keys/da0.key1"
943*e4b0a90eSBrooks Davisgeli_da0_keyfile2_load="YES"
944*e4b0a90eSBrooks Davisgeli_da0_keyfile2_type="da0:geli_keyfile2"
945*e4b0a90eSBrooks Davisgeli_da0_keyfile2_name="/boot/keys/da0.key2"
946*e4b0a90eSBrooks Davis
947*e4b0a90eSBrooks Davisgeli_da1s3a_keyfile0_load="YES"
948*e4b0a90eSBrooks Davisgeli_da1s3a_keyfile0_type="da1s3a:geli_keyfile0"
949*e4b0a90eSBrooks Davisgeli_da1s3a_keyfile0_name="/boot/keys/da1s3a.key"
950*e4b0a90eSBrooks Davis.Ed
951*e4b0a90eSBrooks Davis.Pp
952*e4b0a90eSBrooks DavisIf there is only one keyfile, the index might be omitted:
953*e4b0a90eSBrooks Davis.Bd -literal -offset indent
954*e4b0a90eSBrooks Davisgeli_da1s3a_keyfile_load="YES"
955*e4b0a90eSBrooks Davisgeli_da1s3a_keyfile_type="da1s3a:geli_keyfile"
956*e4b0a90eSBrooks Davisgeli_da1s3a_keyfile_name="/boot/keys/da1s3a.key"
957*e4b0a90eSBrooks Davis.Ed
958*e4b0a90eSBrooks Davis.Pp
959*e4b0a90eSBrooks DavisNot only configure encryption, but also data integrity verification using
960*e4b0a90eSBrooks Davis.Nm HMAC/SHA256 .
961*e4b0a90eSBrooks Davis.Bd -literal -offset indent
962*e4b0a90eSBrooks Davis# geli init -a hmac/sha256 -s 4096 /dev/da0
963*e4b0a90eSBrooks DavisEnter new passphrase:
964*e4b0a90eSBrooks DavisReenter new passphrase:
965*e4b0a90eSBrooks Davis# geli attach /dev/da0
966*e4b0a90eSBrooks DavisEnter passphrase:
967*e4b0a90eSBrooks Davis# dd if=/dev/random of=/dev/da0.eli bs=1m
968*e4b0a90eSBrooks Davis# newfs /dev/da0.eli
969*e4b0a90eSBrooks Davis# mount /dev/da0.eli /mnt/secret
970*e4b0a90eSBrooks Davis.Ed
971*e4b0a90eSBrooks Davis.Pp
972*e4b0a90eSBrooks Davis.Cm geli
973*e4b0a90eSBrooks Daviswrites the metadata backup by default to the
974*e4b0a90eSBrooks Davis.Pa /var/backups/<prov>.eli
975*e4b0a90eSBrooks Davisfile.
976*e4b0a90eSBrooks DavisIf the metadata is lost in any way (e.g., by accidental overwrite), it can be restored.
977*e4b0a90eSBrooks DavisConsider the following situation:
978*e4b0a90eSBrooks Davis.Bd -literal -offset indent
979*e4b0a90eSBrooks Davis# geli init /dev/da0
980*e4b0a90eSBrooks DavisEnter new passphrase:
981*e4b0a90eSBrooks DavisReenter new passphrase:
982*e4b0a90eSBrooks Davis
983*e4b0a90eSBrooks DavisMetadata backup can be found in /var/backups/da0.eli and
984*e4b0a90eSBrooks Daviscan be restored with the following command:
985*e4b0a90eSBrooks Davis
986*e4b0a90eSBrooks Davis	# geli restore /var/backups/da0.eli /dev/da0
987*e4b0a90eSBrooks Davis
988*e4b0a90eSBrooks Davis# geli clear /dev/da0
989*e4b0a90eSBrooks Davis# geli attach /dev/da0
990*e4b0a90eSBrooks Davisgeli: Cannot read metadata from /dev/da0: Invalid argument.
991*e4b0a90eSBrooks Davis# geli restore /var/backups/da0.eli /dev/da0
992*e4b0a90eSBrooks Davis# geli attach /dev/da0
993*e4b0a90eSBrooks DavisEnter passphrase:
994*e4b0a90eSBrooks Davis.Ed
995*e4b0a90eSBrooks Davis.Pp
996*e4b0a90eSBrooks DavisIf an encrypted file system is extended, it is necessary to relocate and
997*e4b0a90eSBrooks Davisupdate the metadata:
998*e4b0a90eSBrooks Davis.Bd -literal -offset indent
999*e4b0a90eSBrooks Davis# gpart create -s GPT ada0
1000*e4b0a90eSBrooks Davis# gpart add -s 1g -t freebsd-ufs -i 1 ada0
1001*e4b0a90eSBrooks Davis# geli init -K keyfile -P ada0p1
1002*e4b0a90eSBrooks Davis# gpart resize -s 2g -i 1 ada0
1003*e4b0a90eSBrooks Davis# geli resize -s 1g ada0p1
1004*e4b0a90eSBrooks Davis# geli attach -k keyfile -p ada0p1
1005*e4b0a90eSBrooks Davis.Ed
1006*e4b0a90eSBrooks Davis.Pp
1007*e4b0a90eSBrooks DavisInitialize provider with the passphrase split into two files.
1008*e4b0a90eSBrooks DavisThe provider can be attached using those two files or by entering
1009*e4b0a90eSBrooks Davis.Dq foobar
1010*e4b0a90eSBrooks Davisas the passphrase at the
1011*e4b0a90eSBrooks Davis.Nm
1012*e4b0a90eSBrooks Davisprompt:
1013*e4b0a90eSBrooks Davis.Bd -literal -offset indent
1014*e4b0a90eSBrooks Davis# echo foo > da0.pass0
1015*e4b0a90eSBrooks Davis# echo bar > da0.pass1
1016*e4b0a90eSBrooks Davis# geli init -J da0.pass0 -J da0.pass1 da0
1017*e4b0a90eSBrooks Davis# geli attach -j da0.pass0 -j da0.pass1 da0
1018*e4b0a90eSBrooks Davis# geli detach da0
1019*e4b0a90eSBrooks Davis# geli attach da0
1020*e4b0a90eSBrooks DavisEnter passphrase: foobar
1021*e4b0a90eSBrooks Davis.Ed
1022*e4b0a90eSBrooks Davis.Pp
1023*e4b0a90eSBrooks DavisSuspend all
1024*e4b0a90eSBrooks Davis.Nm
1025*e4b0a90eSBrooks Davisdevices on a laptop, suspend the laptop, then resume devices one by one after
1026*e4b0a90eSBrooks Davisresuming the laptop:
1027*e4b0a90eSBrooks Davis.Bd -literal -offset indent
1028*e4b0a90eSBrooks Davis# geli suspend -a
1029*e4b0a90eSBrooks Davis# zzz
1030*e4b0a90eSBrooks Davis<resume your laptop>
1031*e4b0a90eSBrooks Davis# geli resume -p -k keyfile gpt/secret
1032*e4b0a90eSBrooks Davis# geli resume gpt/private
1033*e4b0a90eSBrooks DavisEnter passphrase:
1034*e4b0a90eSBrooks Davis.Ed
1035*e4b0a90eSBrooks Davis.Sh ENCRYPTION MODES
1036*e4b0a90eSBrooks Davis.Nm
1037*e4b0a90eSBrooks Davissupports two encryption modes:
1038*e4b0a90eSBrooks Davis.Nm XTS ,
1039*e4b0a90eSBrooks Daviswhich was standardized as
1040*e4b0a90eSBrooks Davis.Nm IEEE P1619
1041*e4b0a90eSBrooks Davisand
1042*e4b0a90eSBrooks Davis.Nm CBC
1043*e4b0a90eSBrooks Daviswith unpredictable IV.
1044*e4b0a90eSBrooks DavisThe
1045*e4b0a90eSBrooks Davis.Nm CBC
1046*e4b0a90eSBrooks Davismode used by
1047*e4b0a90eSBrooks Davis.Nm
1048*e4b0a90eSBrooks Davisis very similar to the mode
1049*e4b0a90eSBrooks Davis.Nm ESSIV .
1050*e4b0a90eSBrooks Davis.Sh DATA AUTHENTICATION
1051*e4b0a90eSBrooks Davis.Nm
1052*e4b0a90eSBrooks Daviscan verify data integrity when an authentication algorithm is specified.
1053*e4b0a90eSBrooks DavisWhen data corruption/modification is detected,
1054*e4b0a90eSBrooks Davis.Nm
1055*e4b0a90eSBrooks Daviswill not return any data, but instead will return an error
1056*e4b0a90eSBrooks Davis.Pq Er EINVAL .
1057*e4b0a90eSBrooks DavisThe offset and size of the corrupted data will be printed on the console.
1058*e4b0a90eSBrooks DavisIt is important to know against which attacks
1059*e4b0a90eSBrooks Davis.Nm
1060*e4b0a90eSBrooks Davisprovides protection for your data.
1061*e4b0a90eSBrooks DavisIf data is modified in-place or copied from one place on the disk
1062*e4b0a90eSBrooks Davisto another even without modification,
1063*e4b0a90eSBrooks Davis.Nm
1064*e4b0a90eSBrooks Davisshould be able to detect such a change.
1065*e4b0a90eSBrooks DavisIf an attacker can remember the encrypted data, he can overwrite any future
1066*e4b0a90eSBrooks Davischanges with the data he owns without it being noticed.
1067*e4b0a90eSBrooks DavisIn other words
1068*e4b0a90eSBrooks Davis.Nm
1069*e4b0a90eSBrooks Daviswill not protect your data against replay attacks.
1070*e4b0a90eSBrooks Davis.Pp
1071*e4b0a90eSBrooks DavisIt is recommended to write to the whole provider before first use,
1072*e4b0a90eSBrooks Davisin order to make sure that all sectors and their corresponding
1073*e4b0a90eSBrooks Davischecksums are properly initialized into a consistent state.
1074*e4b0a90eSBrooks DavisOne can safely ignore data authentication errors that occur immediately
1075*e4b0a90eSBrooks Davisafter the first time a provider is attached and before it is
1076*e4b0a90eSBrooks Davisinitialized in this way.
1077*e4b0a90eSBrooks Davis.Sh SEE ALSO
1078*e4b0a90eSBrooks Davis.Xr crypto 4 ,
1079*e4b0a90eSBrooks Davis.Xr gbde 4 ,
1080*e4b0a90eSBrooks Davis.Xr geom 4 ,
1081*e4b0a90eSBrooks Davis.Xr loader.conf 5 ,
1082*e4b0a90eSBrooks Davis.Xr gbde 8 ,
1083*e4b0a90eSBrooks Davis.Xr geom 8 ,
1084*e4b0a90eSBrooks Davis.Xr crypto 9
1085*e4b0a90eSBrooks Davis.Sh HISTORY
1086*e4b0a90eSBrooks DavisThe
1087*e4b0a90eSBrooks Davis.Nm
1088*e4b0a90eSBrooks Davisutility appeared in
1089*e4b0a90eSBrooks Davis.Fx 6.0 .
1090*e4b0a90eSBrooks DavisSupport for the
1091*e4b0a90eSBrooks Davis.Nm Camellia
1092*e4b0a90eSBrooks Davisblock cipher is implemented by Yoshisato Yanagisawa in
1093*e4b0a90eSBrooks Davis.Fx 7.0 .
1094*e4b0a90eSBrooks Davis.Pp
1095*e4b0a90eSBrooks DavisHighest
1096*e4b0a90eSBrooks Davis.Nm GELI
1097*e4b0a90eSBrooks Davismetadata version supported by the given FreeBSD version:
1098*e4b0a90eSBrooks Davis.Bl -column -offset indent ".Sy FreeBSD" ".Sy version"
1099*e4b0a90eSBrooks Davis.It Sy FreeBSD Ta Sy GELI
1100*e4b0a90eSBrooks Davis.It Sy version Ta Sy version
1101*e4b0a90eSBrooks Davis.Pp
1102*e4b0a90eSBrooks Davis.It Li 6.0 Ta 0
1103*e4b0a90eSBrooks Davis.It Li 6.1 Ta 0
1104*e4b0a90eSBrooks Davis.It Li 6.2 Ta 3
1105*e4b0a90eSBrooks Davis.It Li 6.3 Ta 3
1106*e4b0a90eSBrooks Davis.It Li 6.4 Ta 3
1107*e4b0a90eSBrooks Davis.Pp
1108*e4b0a90eSBrooks Davis.It Li 7.0 Ta 3
1109*e4b0a90eSBrooks Davis.It Li 7.1 Ta 3
1110*e4b0a90eSBrooks Davis.It Li 7.2 Ta 3
1111*e4b0a90eSBrooks Davis.It Li 7.3 Ta 3
1112*e4b0a90eSBrooks Davis.It Li 7.4 Ta 3
1113*e4b0a90eSBrooks Davis.Pp
1114*e4b0a90eSBrooks Davis.It Li 8.0 Ta 3
1115*e4b0a90eSBrooks Davis.It Li 8.1 Ta 3
1116*e4b0a90eSBrooks Davis.It Li 8.2 Ta 5
1117*e4b0a90eSBrooks Davis.Pp
1118*e4b0a90eSBrooks Davis.It Li 9.0 Ta 6
1119*e4b0a90eSBrooks Davis.Pp
1120*e4b0a90eSBrooks Davis.It Li 10.0 Ta 7
1121*e4b0a90eSBrooks Davis.El
1122*e4b0a90eSBrooks Davis.Sh AUTHORS
1123*e4b0a90eSBrooks Davis.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org
1124