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