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*e2b99193SJohn Baldwin.Dd April 14, 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 Davisand 176*e2b99193SJohn Baldwin.Nm Camellia-CBC ) . 177e4b0a90eSBrooks Davis.It 178e4b0a90eSBrooks DavisCan optionally perform data authentication (integrity verification) utilizing 179e4b0a90eSBrooks Davisone of the following algorithms: 180e4b0a90eSBrooks Davis.Nm HMAC/SHA1 , 181e4b0a90eSBrooks Davis.Nm HMAC/RIPEMD160 , 182e4b0a90eSBrooks Davis.Nm HMAC/SHA256 , 183e4b0a90eSBrooks Davis.Nm HMAC/SHA384 184e4b0a90eSBrooks Davisor 185e4b0a90eSBrooks Davis.Nm HMAC/SHA512 . 186e4b0a90eSBrooks Davis.It 187e4b0a90eSBrooks DavisCan create a User Key from up to two, piecewise components: a passphrase 188e4b0a90eSBrooks Davisentered via prompt or read from one or more passfiles; a keyfile read from 189e4b0a90eSBrooks Davisone or more files. 190e4b0a90eSBrooks Davis.It 191e4b0a90eSBrooks DavisAllows encryption of the root partition. 192217df2daSBen WoodsThe user is asked for the passphrase before the root filesystem is mounted. 193e4b0a90eSBrooks Davis.It 194e4b0a90eSBrooks DavisStrengthens the passphrase component of the User Key with: 195e4b0a90eSBrooks Davis.Rs 196e4b0a90eSBrooks Davis.%A B. Kaliski 197e4b0a90eSBrooks Davis.%T "PKCS #5: Password-Based Cryptography Specification, Version 2.0." 198e4b0a90eSBrooks Davis.%R RFC 199e4b0a90eSBrooks Davis.%N 2898 200e4b0a90eSBrooks Davis.Re 201e4b0a90eSBrooks Davis.It 202e4b0a90eSBrooks DavisAllows the use of two independent User Keys (e.g., a 203e4b0a90eSBrooks Davis.Qq "user key" 204e4b0a90eSBrooks Davisand a 205e4b0a90eSBrooks Davis.Qq "company key" ) . 206e4b0a90eSBrooks Davis.It 207e4b0a90eSBrooks DavisIt is fast - 208e4b0a90eSBrooks Davis.Nm 209e4b0a90eSBrooks Davisperforms simple sector-to-sector encryption. 210e4b0a90eSBrooks Davis.It 211e4b0a90eSBrooks DavisAllows the encrypted Master Key to be backed up and restored, 212e4b0a90eSBrooks Davisso that if a user has to quickly destroy key material, 213e4b0a90eSBrooks Davisit is possible to get the data back by restoring keys from 214e4b0a90eSBrooks Davisbackup. 215e4b0a90eSBrooks Davis.It 216217df2daSBen WoodsProviders can be configured to automatically detach on last close, 217217df2daSBen Woodsso users do not have to remember to detach providers after unmounting 218217df2daSBen Woodsthe filesystems. 219e4b0a90eSBrooks Davis.It 220217df2daSBen WoodsAllows attaching a provider with a random, one-time Master Key, 221217df2daSBen Woodswhich is useful for swap partitions and temporary filesystems. 222e4b0a90eSBrooks Davis.It 223e4b0a90eSBrooks DavisAllows verification of data integrity (data authentication). 224e4b0a90eSBrooks Davis.It 225e4b0a90eSBrooks DavisAllows suspending and resuming encrypted devices. 226e4b0a90eSBrooks Davis.El 227e4b0a90eSBrooks Davis.Pp 228e4b0a90eSBrooks DavisThe first argument to 229e4b0a90eSBrooks Davis.Nm 230e4b0a90eSBrooks Davisindicates an action to be performed: 231e4b0a90eSBrooks Davis.Bl -tag -width ".Cm configure" 232e4b0a90eSBrooks Davis.It Cm init 233368455ecSBen WoodsInitialize providers which need to be encrypted. 234368455ecSBen WoodsIf multiple providers are listed as arguments, they will all be initialized 235368455ecSBen Woodswith the same passphrase and/or User Key. 236368455ecSBen WoodsA unique salt will be randomly generated for each provider to ensure the 237368455ecSBen WoodsMaster Key for each is unique. 238e4b0a90eSBrooks DavisHere you can set up the cryptographic algorithm to use, Data Key length, 239e4b0a90eSBrooks Davisetc. 240368455ecSBen WoodsThe last sector of the providers is used to store metadata. 241e4b0a90eSBrooks DavisThe 242e4b0a90eSBrooks Davis.Cm init 243e4b0a90eSBrooks Davissubcommand also automatically writes metadata backups to 244e4b0a90eSBrooks Davis.Pa /var/backups/<prov>.eli 245e4b0a90eSBrooks Davisfile. 246e4b0a90eSBrooks DavisThe metadata can be recovered with the 247e4b0a90eSBrooks Davis.Cm restore 248e4b0a90eSBrooks Davissubcommand described below. 249e4b0a90eSBrooks Davis.Pp 250e4b0a90eSBrooks DavisAdditional options include: 251e4b0a90eSBrooks Davis.Bl -tag -width ".Fl J Ar newpassfile" 252e4b0a90eSBrooks Davis.It Fl a Ar aalgo 253e4b0a90eSBrooks DavisEnable data integrity verification (authentication) using the given algorithm. 254e4b0a90eSBrooks DavisThis will reduce the size of storage available and also reduce speed. 255e4b0a90eSBrooks DavisFor example, when using 4096 bytes sector and 256e4b0a90eSBrooks Davis.Nm HMAC/SHA256 257e4b0a90eSBrooks Davisalgorithm, 89% of the original provider storage will be available for use. 258e4b0a90eSBrooks DavisCurrently supported algorithms are: 259e4b0a90eSBrooks Davis.Nm HMAC/SHA1 , 260e4b0a90eSBrooks Davis.Nm HMAC/RIPEMD160 , 261e4b0a90eSBrooks Davis.Nm HMAC/SHA256 , 262e4b0a90eSBrooks Davis.Nm HMAC/SHA384 263e4b0a90eSBrooks Davisand 264e4b0a90eSBrooks Davis.Nm HMAC/SHA512 . 265e4b0a90eSBrooks DavisIf the option is not given, there will be no authentication, only encryption. 266e4b0a90eSBrooks DavisThe recommended algorithm is 267e4b0a90eSBrooks Davis.Nm HMAC/SHA256 . 268e4b0a90eSBrooks Davis.It Fl b 269e4b0a90eSBrooks DavisTry to decrypt this partition during boot, before the root partition is mounted. 270e4b0a90eSBrooks DavisThis makes it possible to use an encrypted root partition. 271e4b0a90eSBrooks DavisOne will still need bootable unencrypted storage with a 272e4b0a90eSBrooks Davis.Pa /boot/ 273e4b0a90eSBrooks Davisdirectory, which can be a CD-ROM disc or USB pen-drive, that can be removed 274e4b0a90eSBrooks Davisafter boot. 275e4b0a90eSBrooks Davis.It Fl B Ar backupfile 276e4b0a90eSBrooks DavisFile name to use for metadata backup instead of the default 277e4b0a90eSBrooks Davis.Pa /var/backups/<prov>.eli . 278e4b0a90eSBrooks DavisTo inhibit backups, you can use 279e4b0a90eSBrooks Davis.Pa none 280e4b0a90eSBrooks Davisas the 281e4b0a90eSBrooks Davis.Ar backupfile . 282368455ecSBen WoodsIf multiple providers were initialized in the one command, you can use 283368455ecSBen Woods.Pa PROV 284368455ecSBen Woods(all upper-case) in the file name, and it will be replaced with the provider 285368455ecSBen Woodsname. 286368455ecSBen WoodsIf 287368455ecSBen Woods.Pa PROV 288368455ecSBen Woodsis not found in the file name and multiple providers were initialized in the 289368455ecSBen Woodsone command, 290368455ecSBen Woods.Pa -<prov> 291368455ecSBen Woodswill be appended to the end of the file name specified. 292e4b0a90eSBrooks Davis.It Fl d 293e4b0a90eSBrooks DavisWhen entering the passphrase to boot from this encrypted root filesystem, echo 294e4b0a90eSBrooks Davis.Ql * 295e4b0a90eSBrooks Davischaracters. 296e4b0a90eSBrooks DavisThis makes the length of the passphrase visible. 297e4b0a90eSBrooks Davis.It Fl e Ar ealgo 298e4b0a90eSBrooks DavisEncryption algorithm to use. 299e4b0a90eSBrooks DavisCurrently supported algorithms are: 300e4b0a90eSBrooks Davis.Nm AES-XTS , 301e4b0a90eSBrooks Davis.Nm AES-CBC , 302e4b0a90eSBrooks Davis.Nm Camellia-CBC , 303e4b0a90eSBrooks Davisand 304e4b0a90eSBrooks Davis.Nm NULL . 305e4b0a90eSBrooks DavisThe default and recommended algorithm is 306e4b0a90eSBrooks Davis.Nm AES-XTS . 307e4b0a90eSBrooks Davis.Nm NULL 308e4b0a90eSBrooks Davisis unencrypted. 309e4b0a90eSBrooks Davis.It Fl g 310e4b0a90eSBrooks DavisEnable booting from this encrypted root filesystem. 311e4b0a90eSBrooks DavisThe boot loader prompts for the passphrase and loads 312e4b0a90eSBrooks Davis.Xr loader 8 313e4b0a90eSBrooks Davisfrom the encrypted partition. 314e4b0a90eSBrooks Davis.It Fl i Ar iterations 315e4b0a90eSBrooks DavisNumber of iterations to use with PKCS#5v2 when processing User Key 316e4b0a90eSBrooks Davispassphrase component. 317e4b0a90eSBrooks DavisIf this option is not specified, 318e4b0a90eSBrooks Davis.Nm 319e4b0a90eSBrooks Daviswill find the number of iterations which is equal to 2 seconds of crypto work. 320e4b0a90eSBrooks DavisIf 0 is given, PKCS#5v2 will not be used. 321e4b0a90eSBrooks DavisPKCS#5v2 processing is performed once, after all parts of the passphrase 322e4b0a90eSBrooks Daviscomponent have been read. 323e4b0a90eSBrooks Davis.It Fl J Ar newpassfile 324e4b0a90eSBrooks DavisSpecifies a file which contains the passphrase component of the User Key 325e4b0a90eSBrooks Davis(or part of it). 326e4b0a90eSBrooks DavisIf 327e4b0a90eSBrooks Davis.Ar newpassfile 328e4b0a90eSBrooks Davisis given as -, standard input will be used. 329e4b0a90eSBrooks DavisOnly the first line (excluding new-line character) is taken from the given file. 330e4b0a90eSBrooks DavisThis argument can be specified multiple times, which has the effect of 331e4b0a90eSBrooks Davisreassembling a single passphrase split across multiple files. 332e4b0a90eSBrooks DavisCannot be combined with the 333e4b0a90eSBrooks Davis.Fl P 334e4b0a90eSBrooks Davisoption. 335e4b0a90eSBrooks Davis.It Fl K Ar newkeyfile 336e4b0a90eSBrooks DavisSpecifies a file which contains the keyfile component of the User Key 337e4b0a90eSBrooks Davis(or part of it). 338e4b0a90eSBrooks DavisIf 339e4b0a90eSBrooks Davis.Ar newkeyfile 340e4b0a90eSBrooks Davisis given as -, standard input will be used. 341e4b0a90eSBrooks DavisThis argument can be specified multiple times, which has the effect of 342e4b0a90eSBrooks Davisreassembling a single keyfile split across multiple keyfile parts. 343e4b0a90eSBrooks Davis.It Fl l Ar keylen 344e4b0a90eSBrooks DavisData Key length to use with the given cryptographic algorithm. 345e4b0a90eSBrooks DavisIf the length is not specified, the selected algorithm uses its 346e4b0a90eSBrooks Davis.Em default 347e4b0a90eSBrooks Daviskey length. 348e4b0a90eSBrooks Davis.Bl -ohang -offset indent 349e4b0a90eSBrooks Davis.It Nm AES-XTS 350e4b0a90eSBrooks Davis.Em 128 , 351e4b0a90eSBrooks Davis256 352e4b0a90eSBrooks Davis.It Nm AES-CBC , Nm Camellia-CBC 353e4b0a90eSBrooks Davis.Em 128 , 354e4b0a90eSBrooks Davis192, 355e4b0a90eSBrooks Davis256 356e4b0a90eSBrooks Davis.El 357e4b0a90eSBrooks Davis.It Fl P 358e4b0a90eSBrooks DavisDo not use a passphrase as a component of the User Key. 359e4b0a90eSBrooks DavisCannot be combined with the 360e4b0a90eSBrooks Davis.Fl J 361e4b0a90eSBrooks Davisoption. 362e4b0a90eSBrooks Davis.It Fl s Ar sectorsize 363e4b0a90eSBrooks DavisChange decrypted provider's sector size. 364e4b0a90eSBrooks DavisIncreasing the sector size allows increased performance, 365e4b0a90eSBrooks Davisbecause encryption/decryption which requires an initialization vector 366e4b0a90eSBrooks Davisis done per sector; fewer sectors means less computational work. 3672f07cdf8SPawel Jakub Dawidek.It Fl R 3682f07cdf8SPawel Jakub DawidekTurn off automatic expansion. 3692f07cdf8SPawel Jakub DawidekBy default, if the underlying provider grows, the encrypted provider will 3702f07cdf8SPawel Jakub Dawidekgrow automatically too. 3712f07cdf8SPawel Jakub DawidekThe metadata will be moved to the new location. 3722f07cdf8SPawel Jakub DawidekIf automatic expansion if turned off and the underlying provider changes 3732f07cdf8SPawel Jakub Dawideksize, attaching encrypted provider will no longer be possible as the metadata 3742f07cdf8SPawel Jakub Dawidekwill no longer be located in the last sector. 3752f07cdf8SPawel Jakub DawidekIn this case 3762f07cdf8SPawel Jakub Dawidek.Nm GELI 3772f07cdf8SPawel Jakub Dawidekwill only log the previous size of the underlying provider, so metadata can 3782f07cdf8SPawel Jakub Dawidekbe found easier, if resize was done by mistake. 379e4b0a90eSBrooks Davis.It Fl T 380e4b0a90eSBrooks DavisDon't pass through 381e4b0a90eSBrooks Davis.Dv BIO_DELETE 382e4b0a90eSBrooks Daviscalls (i.e., TRIM/UNMAP). 383e4b0a90eSBrooks DavisThis can prevent an attacker from knowing how much space you're actually 384e4b0a90eSBrooks Davisusing and which sectors contain live data, but will also prevent the 385e4b0a90eSBrooks Davisbacking store (SSD, etc) from reclaiming space you're not using, which 386e4b0a90eSBrooks Davismay degrade its performance and lifespan. 387e4b0a90eSBrooks DavisThe underlying provider may or may not actually obliterate the deleted 388e4b0a90eSBrooks Davissectors when TRIM is enabled, so it should not be considered to add any 389e4b0a90eSBrooks Davissecurity. 390e4b0a90eSBrooks Davis.It Fl V Ar version 391e4b0a90eSBrooks DavisMetadata version to use. 392e4b0a90eSBrooks DavisThis option is helpful when creating a provider that may be used by older 393e4b0a90eSBrooks Davis.Nm FreeBSD/GELI 394e4b0a90eSBrooks Davisversions. 395e4b0a90eSBrooks DavisConsult the 396e4b0a90eSBrooks Davis.Sx HISTORY 397217df2daSBen Woodssection to find which metadata version is supported by which 398217df2daSBen Woods.Fx 399217df2daSBen Woodsversion. 400e4b0a90eSBrooks DavisNote that using an older version of metadata may limit the number of 401e4b0a90eSBrooks Davisfeatures available. 402e4b0a90eSBrooks Davis.El 403e4b0a90eSBrooks Davis.It Cm attach 404217df2daSBen WoodsAttach the given providers. 405217df2daSBen WoodsThe encrypted Master Keys are loaded from the metadata and decrypted 406217df2daSBen Woodsusing the given passphrase/keyfile and new GEOM providers are created 407217df2daSBen Woodsusing the specified provider names. 408217df2daSBen WoodsA 409e4b0a90eSBrooks Davis.Qq .eli 410217df2daSBen Woodssuffix is added to the user specified provider names. 411217df2daSBen WoodsMultiple providers can only be attached with a single 412217df2daSBen Woods.Cm attach 413217df2daSBen Woodscommand if they all have the same passphrase and keyfiles. 414e4b0a90eSBrooks Davis.Pp 415e4b0a90eSBrooks DavisAdditional options include: 416e4b0a90eSBrooks Davis.Bl -tag -width ".Fl j Ar passfile" 417e4b0a90eSBrooks Davis.It Fl C 418e4b0a90eSBrooks DavisDo a dry-run decryption. 419e4b0a90eSBrooks DavisThis is useful to verify passphrase and keyfile without decrypting the device. 420e4b0a90eSBrooks Davis.It Fl d 421217df2daSBen WoodsIf specified, the decrypted providers are detached automatically on last close, 422217df2daSBen Woodsso the user does not have to remember to detach 423217df2daSBen Woodsproviders after unmounting the filesystems. 424217df2daSBen WoodsThis only works when providers were opened for writing, and will not work if 425217df2daSBen Woodsthe filesystems on the providers were mounted read-only. 426e4b0a90eSBrooks DavisProbably a better choice is the 427e4b0a90eSBrooks Davis.Fl l 428e4b0a90eSBrooks Davisoption for the 429e4b0a90eSBrooks Davis.Cm detach 430e4b0a90eSBrooks Davissubcommand. 431e4b0a90eSBrooks Davis.It Fl n Ar keyno 432e4b0a90eSBrooks DavisSpecifies the index number of the Master Key copy to use (could be 0 or 1). 433e4b0a90eSBrooks DavisIf the index number is not provided all keys will be tested. 434e4b0a90eSBrooks Davis.It Fl j Ar passfile 435e4b0a90eSBrooks DavisSpecifies a file which contains the passphrase component of the User Key 436e4b0a90eSBrooks Davis(or part of it). 437e4b0a90eSBrooks DavisFor more information see the description of the 438e4b0a90eSBrooks Davis.Fl J 439e4b0a90eSBrooks Davisoption for the 440e4b0a90eSBrooks Davis.Cm init 441e4b0a90eSBrooks Davissubcommand. 442217df2daSBen WoodsThe same passfiles are used for all listed providers. 443e4b0a90eSBrooks Davis.It Fl k Ar keyfile 444e4b0a90eSBrooks DavisSpecifies a file which contains the keyfile component of the User Key 445e4b0a90eSBrooks Davis(or part of it). 446e4b0a90eSBrooks DavisFor more information see the description of the 447e4b0a90eSBrooks Davis.Fl K 448e4b0a90eSBrooks Davisoption for the 449e4b0a90eSBrooks Davis.Cm init 450e4b0a90eSBrooks Davissubcommand. 451217df2daSBen WoodsThe same keyfiles are used for all listed providers. 452e4b0a90eSBrooks Davis.It Fl p 453217df2daSBen WoodsDo not use a passphrase as a component of the User Keys. 454e4b0a90eSBrooks DavisCannot be combined with the 455e4b0a90eSBrooks Davis.Fl j 456e4b0a90eSBrooks Davisoption. 457e4b0a90eSBrooks Davis.It Fl r 458217df2daSBen WoodsAttach read-only providers. 459217df2daSBen WoodsThey are not opened for writing. 460e4b0a90eSBrooks Davis.El 461e4b0a90eSBrooks Davis.It Cm detach 462e4b0a90eSBrooks DavisDetach the given providers, which means remove the devfs entry 463e4b0a90eSBrooks Davisand clear the Master Key and Data Keys from memory. 464e4b0a90eSBrooks Davis.Pp 465e4b0a90eSBrooks DavisAdditional options include: 466e4b0a90eSBrooks Davis.Bl -tag -width ".Fl f" 467e4b0a90eSBrooks Davis.It Fl f 468e4b0a90eSBrooks DavisForce detach - detach even if the provider is open. 469e4b0a90eSBrooks Davis.It Fl l 470217df2daSBen WoodsMark provider to detach on last close, after the last filesystem has been 471217df2daSBen Woodsunmounted. 472e4b0a90eSBrooks DavisIf this option is specified, the provider will not be detached 473e4b0a90eSBrooks Daviswhile it is open, but will be automatically detached when it is closed for the 474e4b0a90eSBrooks Davislast time even if it was only opened for reading. 475e4b0a90eSBrooks Davis.El 476e4b0a90eSBrooks Davis.It Cm onetime 477e4b0a90eSBrooks DavisAttach the given providers with a random, one-time (ephemeral) Master Key. 478e4b0a90eSBrooks DavisThe command can be used to encrypt swap partitions or temporary filesystems. 479e4b0a90eSBrooks Davis.Pp 480e4b0a90eSBrooks DavisAdditional options include: 481e4b0a90eSBrooks Davis.Bl -tag -width ".Fl a Ar sectorsize" 482e4b0a90eSBrooks Davis.It Fl a Ar aalgo 483e4b0a90eSBrooks DavisEnable data integrity verification (authentication). 484e4b0a90eSBrooks DavisFor more information, see the description of the 485e4b0a90eSBrooks Davis.Cm init 486e4b0a90eSBrooks Davissubcommand. 487e4b0a90eSBrooks Davis.It Fl e Ar ealgo 488e4b0a90eSBrooks DavisEncryption algorithm to use. 489e4b0a90eSBrooks DavisFor more information, see the description of the 490e4b0a90eSBrooks Davis.Cm init 491e4b0a90eSBrooks Davissubcommand. 492e4b0a90eSBrooks Davis.It Fl d 493217df2daSBen WoodsDetach on last close, after the last filesystem has been unmounted. 494217df2daSBen WoodsNote: this option is not usable for temporary filesystems as the provider is 495217df2daSBen Woodsdetached after the filesystem has been created. 496217df2daSBen WoodsIt still can, and should, be used for swap partitions. 497e4b0a90eSBrooks DavisFor more information, see the description of the 498e4b0a90eSBrooks Davis.Cm attach 499e4b0a90eSBrooks Davissubcommand. 500e4b0a90eSBrooks Davis.It Fl l Ar keylen 501e4b0a90eSBrooks DavisData Key length to use with the given cryptographic algorithm. 502e4b0a90eSBrooks DavisFor more information, see the description of the 503e4b0a90eSBrooks Davis.Cm init 504e4b0a90eSBrooks Davissubcommand. 505e4b0a90eSBrooks Davis.It Fl s Ar sectorsize 506e4b0a90eSBrooks DavisChange decrypted provider's sector size. 507e4b0a90eSBrooks DavisFor more information, see the description of the 508e4b0a90eSBrooks Davis.Cm init 509e4b0a90eSBrooks Davissubcommand. 5102f07cdf8SPawel Jakub Dawidek.It Fl R 5112f07cdf8SPawel Jakub DawidekTurn off automatic expansion. 5122f07cdf8SPawel Jakub DawidekFor more information, see the description of the 5132f07cdf8SPawel Jakub Dawidek.Cm init 5142f07cdf8SPawel Jakub Dawideksubcommand. 515e4b0a90eSBrooks Davis.It Fl T 516e4b0a90eSBrooks DavisDisable TRIM/UNMAP passthru. 517e4b0a90eSBrooks DavisFor more information, see the description of the 518e4b0a90eSBrooks Davis.Cm init 519e4b0a90eSBrooks Davissubcommand. 520e4b0a90eSBrooks Davis.El 521e4b0a90eSBrooks Davis.It Cm configure 522e4b0a90eSBrooks DavisChange configuration of the given providers. 523e4b0a90eSBrooks Davis.Pp 524e4b0a90eSBrooks DavisAdditional options include: 525e4b0a90eSBrooks Davis.Bl -tag -width ".Fl b" 526e4b0a90eSBrooks Davis.It Fl b 527e4b0a90eSBrooks DavisSet the BOOT flag on the given providers. 528e4b0a90eSBrooks DavisFor more information, see the description of the 529e4b0a90eSBrooks Davis.Cm init 530e4b0a90eSBrooks Davissubcommand. 531e4b0a90eSBrooks Davis.It Fl B 532e4b0a90eSBrooks DavisRemove the BOOT flag from the given providers. 533e4b0a90eSBrooks Davis.It Fl d 534e4b0a90eSBrooks DavisWhen entering the passphrase to boot from this encrypted root filesystem, echo 535e4b0a90eSBrooks Davis.Ql * 536e4b0a90eSBrooks Davischaracters. 537e4b0a90eSBrooks DavisThis makes the length of the passphrase visible. 538e4b0a90eSBrooks Davis.It Fl D 539e4b0a90eSBrooks DavisDisable echoing of any characters when a passphrase is entered to boot from this 540e4b0a90eSBrooks Davisencrypted root filesystem. 541e4b0a90eSBrooks DavisThis hides the passphrase length. 542e4b0a90eSBrooks Davis.It Fl g 543e4b0a90eSBrooks DavisEnable booting from this encrypted root filesystem. 544e4b0a90eSBrooks DavisThe boot loader prompts for the passphrase and loads 545e4b0a90eSBrooks Davis.Xr loader 8 546e4b0a90eSBrooks Davisfrom the encrypted partition. 547e4b0a90eSBrooks Davis.It Fl G 548e4b0a90eSBrooks DavisDeactivate booting from this encrypted root partition. 5492f07cdf8SPawel Jakub Dawidek.It Fl r 5502f07cdf8SPawel Jakub DawidekTurn on automatic expansion. 5512f07cdf8SPawel Jakub DawidekFor more information, see the description of the 5522f07cdf8SPawel Jakub Dawidek.Cm init 5532f07cdf8SPawel Jakub Dawideksubcommand. 5542f07cdf8SPawel Jakub Dawidek.It Fl R 5552f07cdf8SPawel Jakub DawidekTurn off automatic expansion. 556e4b0a90eSBrooks Davis.It Fl t 557e4b0a90eSBrooks DavisEnable TRIM/UNMAP passthru. 558e4b0a90eSBrooks DavisFor more information, see the description of the 559e4b0a90eSBrooks Davis.Cm init 560e4b0a90eSBrooks Davissubcommand. 561e4b0a90eSBrooks Davis.It Fl T 562e4b0a90eSBrooks DavisDisable TRIM/UNMAP passthru. 563e4b0a90eSBrooks Davis.El 564e4b0a90eSBrooks Davis.It Cm setkey 565e4b0a90eSBrooks DavisInstall a copy of the Master Key into the selected slot, encrypted with 566e4b0a90eSBrooks Davisa new User Key. 567e4b0a90eSBrooks DavisIf the selected slot is populated, replace the existing copy. 568e4b0a90eSBrooks DavisA provider has one Master Key, which can be stored in one or both slots, 569e4b0a90eSBrooks Daviseach encrypted with an independent User Key. 570e4b0a90eSBrooks DavisWith the 571e4b0a90eSBrooks Davis.Cm init 572e4b0a90eSBrooks Davissubcommand, only key number 0 is initialized. 573e4b0a90eSBrooks DavisThe User Key can be changed at any time: for an attached provider, 574e4b0a90eSBrooks Davisfor a detached provider, or on the backup file. 575e4b0a90eSBrooks DavisWhen a provider is attached, the user does not have to provide 576e4b0a90eSBrooks Davisan existing passphrase/keyfile. 577e4b0a90eSBrooks Davis.Pp 578e4b0a90eSBrooks DavisAdditional options include: 579e4b0a90eSBrooks Davis.Bl -tag -width ".Fl J Ar newpassfile" 580e4b0a90eSBrooks Davis.It Fl i Ar iterations 581e4b0a90eSBrooks DavisNumber of iterations to use with PKCS#5v2. 582e4b0a90eSBrooks DavisIf 0 is given, PKCS#5v2 will not be used. 583e4b0a90eSBrooks DavisTo be able to use this option with the 584e4b0a90eSBrooks Davis.Cm setkey 585e4b0a90eSBrooks Davissubcommand, only one key has to be defined and this key must be changed. 586e4b0a90eSBrooks Davis.It Fl j Ar passfile 587e4b0a90eSBrooks DavisSpecifies a file which contains the passphrase component of a current User Key 588e4b0a90eSBrooks Davis(or part of it). 589e4b0a90eSBrooks Davis.It Fl J Ar newpassfile 590e4b0a90eSBrooks DavisSpecifies a file which contains the passphrase component of the new User Key 591e4b0a90eSBrooks Davis(or part of it). 592e4b0a90eSBrooks Davis.It Fl k Ar keyfile 593e4b0a90eSBrooks DavisSpecifies a file which contains the keyfile component of a current User Key 594e4b0a90eSBrooks Davis(or part of it). 595e4b0a90eSBrooks Davis.It Fl K Ar newkeyfile 596e4b0a90eSBrooks DavisSpecifies a file which contains the keyfile component of the new User Key 597e4b0a90eSBrooks Davis(or part of it). 598e4b0a90eSBrooks Davis.It Fl n Ar keyno 599e4b0a90eSBrooks DavisSpecifies the index number of the Master Key copy to change (could be 0 or 1). 600e4b0a90eSBrooks DavisIf the provider is attached and no key number is given, the key 601e4b0a90eSBrooks Davisused for attaching the provider will be changed. 602e4b0a90eSBrooks DavisIf the provider is detached (or we are operating on a backup file) 603e4b0a90eSBrooks Davisand no key number is given, the first Master Key copy to be successfully 604e4b0a90eSBrooks Davisdecrypted with the provided User Key passphrase/keyfile will be changed. 605e4b0a90eSBrooks Davis.It Fl p 606e4b0a90eSBrooks DavisDo not use a passphrase as a component of the current User Key. 607e4b0a90eSBrooks DavisCannot be combined with the 608e4b0a90eSBrooks Davis.Fl j 609e4b0a90eSBrooks Davisoption. 610e4b0a90eSBrooks Davis.It Fl P 611e4b0a90eSBrooks DavisDo not use a passphrase as a component of the new User Key. 612e4b0a90eSBrooks DavisCannot be combined with the 613e4b0a90eSBrooks Davis.Fl J 614e4b0a90eSBrooks Davisoption. 615e4b0a90eSBrooks Davis.El 616e4b0a90eSBrooks Davis.It Cm delkey 617e4b0a90eSBrooks DavisDestroy (overwrite with random data) the selected Master Key copy. 618e4b0a90eSBrooks DavisIf one is destroying keys for an attached provider, the provider 619e4b0a90eSBrooks Daviswill not be detached even if all copies of the Master Key are destroyed. 620e4b0a90eSBrooks DavisIt can even be rescued with the 621e4b0a90eSBrooks Davis.Cm setkey 622e4b0a90eSBrooks Davissubcommand because the Master Key is still in memory. 623e4b0a90eSBrooks Davis.Pp 624e4b0a90eSBrooks DavisAdditional options include: 625e4b0a90eSBrooks Davis.Bl -tag -width ".Fl a Ar keyno" 626e4b0a90eSBrooks Davis.It Fl a 627e4b0a90eSBrooks DavisDestroy all copies of the Master Key (does not need 628e4b0a90eSBrooks Davis.Fl f 629e4b0a90eSBrooks Davisoption). 630e4b0a90eSBrooks Davis.It Fl f 631e4b0a90eSBrooks DavisForce key destruction. 632e4b0a90eSBrooks DavisThis option is needed to destroy the last copy of the Master Key. 633e4b0a90eSBrooks Davis.It Fl n Ar keyno 634e4b0a90eSBrooks DavisSpecifies the index number of the Master Key copy. 635e4b0a90eSBrooks DavisIf the provider is attached and no key number is given, the key 636e4b0a90eSBrooks Davisused for attaching the provider will be destroyed. 637e4b0a90eSBrooks DavisIf provider is detached (or we are operating on a backup file) the key number 638e4b0a90eSBrooks Davishas to be given. 639e4b0a90eSBrooks Davis.El 640e4b0a90eSBrooks Davis.It Cm kill 641e4b0a90eSBrooks DavisThis command should be used only in emergency situations. 642e4b0a90eSBrooks DavisIt will destroy all copies of the Master Key on a given provider and will 643e4b0a90eSBrooks Davisdetach it forcibly (if it is attached). 644e4b0a90eSBrooks DavisThis is absolutely a one-way command - if you do not have a metadata 645e4b0a90eSBrooks Davisbackup, your data is gone for good. 646e4b0a90eSBrooks DavisIn case the provider was attached with the 647e4b0a90eSBrooks Davis.Fl r 648e4b0a90eSBrooks Davisflag, the keys will not be destroyed, only the provider will be detached. 649e4b0a90eSBrooks Davis.Pp 650e4b0a90eSBrooks DavisAdditional options include: 651e4b0a90eSBrooks Davis.Bl -tag -width ".Fl a" 652e4b0a90eSBrooks Davis.It Fl a 653e4b0a90eSBrooks DavisIf specified, all currently attached providers will be killed. 654e4b0a90eSBrooks Davis.El 655e4b0a90eSBrooks Davis.It Cm backup 656e4b0a90eSBrooks DavisBackup metadata from the given provider to the given file. 657e4b0a90eSBrooks Davis.It Cm restore 658e4b0a90eSBrooks DavisRestore metadata from the given file to the given provider. 659e4b0a90eSBrooks Davis.Pp 660e4b0a90eSBrooks DavisAdditional options include: 661e4b0a90eSBrooks Davis.Bl -tag -width ".Fl f" 662e4b0a90eSBrooks Davis.It Fl f 663e4b0a90eSBrooks DavisMetadata contains the size of the provider to ensure that the correct 664e4b0a90eSBrooks Davispartition or slice is attached. 665e4b0a90eSBrooks DavisIf an attempt is made to restore metadata to a provider that has a different 666e4b0a90eSBrooks Davissize, 667e4b0a90eSBrooks Davis.Nm 668e4b0a90eSBrooks Daviswill refuse to restore the data unless the 669e4b0a90eSBrooks Davis.Fl f 670e4b0a90eSBrooks Davisswitch is used. 671e4b0a90eSBrooks DavisIf the partition or slice has been grown, the 672e4b0a90eSBrooks Davis.Cm resize 673e4b0a90eSBrooks Davissubcommand should be used rather than attempting to relocate the metadata 674e4b0a90eSBrooks Davisthrough 675e4b0a90eSBrooks Davis.Cm backup 676e4b0a90eSBrooks Davisand 677e4b0a90eSBrooks Davis.Cm restore . 678e4b0a90eSBrooks Davis.El 679e4b0a90eSBrooks Davis.It Cm suspend 680e4b0a90eSBrooks DavisSuspend device by waiting for all inflight requests to finish, clearing all 681217df2daSBen Woodssensitive information such as the Master Key and Data Keys from kernel memory, 682e4b0a90eSBrooks Davisand blocking all further I/O requests until the 683e4b0a90eSBrooks Davis.Cm resume 684e4b0a90eSBrooks Davissubcommand is executed. 685217df2daSBen WoodsThis functionality is useful for laptops. 686217df2daSBen WoodsSuspending a laptop should not leave an encrypted device attached. 687217df2daSBen WoodsThe 688e4b0a90eSBrooks Davis.Cm suspend 689217df2daSBen Woodssubcommand can be used rather than closing all files and directories from 690217df2daSBen Woodsfilesystems on the encrypted device, unmounting the filesystem, and 691217df2daSBen Woodsdetaching the device. 692e4b0a90eSBrooks DavisAny access to the encrypted device will be blocked until the Master Key is 693e4b0a90eSBrooks Davisreloaded through the 694e4b0a90eSBrooks Davis.Cm resume 695e4b0a90eSBrooks Davissubcommand. 696e4b0a90eSBrooks DavisThus there is no need to close nor unmount anything. 697e4b0a90eSBrooks DavisThe 698e4b0a90eSBrooks Davis.Cm suspend 699e4b0a90eSBrooks Davissubcommand does not work with devices created with the 700e4b0a90eSBrooks Davis.Cm onetime 701e4b0a90eSBrooks Davissubcommand. 702217df2daSBen WoodsPlease note that sensitive data might still be present in memory locations 703217df2daSBen Woodssuch as the filesystem cache after suspending an encrypted device. 704e4b0a90eSBrooks Davis.Pp 705e4b0a90eSBrooks DavisAdditional options include: 706e4b0a90eSBrooks Davis.Bl -tag -width ".Fl a" 707e4b0a90eSBrooks Davis.It Fl a 708e4b0a90eSBrooks DavisSuspend all 709e4b0a90eSBrooks Davis.Nm 710e4b0a90eSBrooks Davisdevices. 711e4b0a90eSBrooks Davis.El 712e4b0a90eSBrooks Davis.It Cm resume 713e4b0a90eSBrooks DavisResume previously suspended device. 714e4b0a90eSBrooks DavisThe caller must ensure that executing this subcommand does not access the 715e4b0a90eSBrooks Davissuspended device, leading to a deadlock. 716217df2daSBen WoodsFor example, suspending a device which contains the filesystem where the 717e4b0a90eSBrooks Davis.Nm 718217df2daSBen Woodsutility is stored is a bad idea. 719e4b0a90eSBrooks Davis.Pp 720e4b0a90eSBrooks DavisAdditional options include: 721e4b0a90eSBrooks Davis.Bl -tag -width ".Fl j Ar passfile" 722e4b0a90eSBrooks Davis.It Fl j Ar passfile 723217df2daSBen WoodsSpecifies a file which contains the passphrase component of the User Key, 724217df2daSBen Woodsor part of it. 725e4b0a90eSBrooks DavisFor more information see the description of the 726e4b0a90eSBrooks Davis.Fl J 727e4b0a90eSBrooks Davisoption for the 728e4b0a90eSBrooks Davis.Cm init 729e4b0a90eSBrooks Davissubcommand. 730e4b0a90eSBrooks Davis.It Fl k Ar keyfile 731217df2daSBen WoodsSpecifies a file which contains the keyfile component of the User Key, 732217df2daSBen Woodsor part of it. 733e4b0a90eSBrooks DavisFor more information see the description of the 734e4b0a90eSBrooks Davis.Fl K 735e4b0a90eSBrooks Davisoption for the 736e4b0a90eSBrooks Davis.Cm init 737e4b0a90eSBrooks Davissubcommand. 738e4b0a90eSBrooks Davis.It Fl p 739e4b0a90eSBrooks DavisDo not use a passphrase as a component of the User Key. 740e4b0a90eSBrooks DavisCannot be combined with the 741e4b0a90eSBrooks Davis.Fl j 742e4b0a90eSBrooks Davisoption. 743e4b0a90eSBrooks Davis.El 744e4b0a90eSBrooks Davis.It Cm resize 745e4b0a90eSBrooks DavisInform 746e4b0a90eSBrooks Davis.Nm 747e4b0a90eSBrooks Davisthat the provider has been resized. 748e4b0a90eSBrooks DavisThe old metadata block is relocated to the correct position at the end of the 749e4b0a90eSBrooks Davisprovider and the provider size is updated. 750e4b0a90eSBrooks Davis.Pp 751e4b0a90eSBrooks DavisAdditional options include: 752e4b0a90eSBrooks Davis.Bl -tag -width ".Fl s Ar oldsize" 753e4b0a90eSBrooks Davis.It Fl s Ar oldsize 754e4b0a90eSBrooks DavisThe size of the provider before it was resized. 755e4b0a90eSBrooks Davis.El 756e4b0a90eSBrooks Davis.It Cm version 757e4b0a90eSBrooks DavisIf no arguments are given, the 758e4b0a90eSBrooks Davis.Cm version 759e4b0a90eSBrooks Davissubcommand will print the version of 760e4b0a90eSBrooks Davis.Nm 761e4b0a90eSBrooks Davisuserland utility as well as the version of the 762e4b0a90eSBrooks Davis.Nm ELI 763e4b0a90eSBrooks DavisGEOM class. 764e4b0a90eSBrooks Davis.Pp 765e4b0a90eSBrooks DavisIf GEOM providers are specified, the 766e4b0a90eSBrooks Davis.Cm version 767e4b0a90eSBrooks Davissubcommand will print metadata version used by each of them. 768e4b0a90eSBrooks Davis.It Cm clear 769e4b0a90eSBrooks DavisClear metadata from the given providers. 770e4b0a90eSBrooks Davis.Em WARNING : 771e4b0a90eSBrooks DavisThis will erase with zeros the encrypted Master Key copies stored in the 772e4b0a90eSBrooks Davismetadata. 773e4b0a90eSBrooks Davis.It Cm dump 774e4b0a90eSBrooks DavisDump metadata stored on the given providers. 775e4b0a90eSBrooks Davis.It Cm list 776e4b0a90eSBrooks DavisSee 777e4b0a90eSBrooks Davis.Xr geom 8 . 778e4b0a90eSBrooks Davis.It Cm status 779e4b0a90eSBrooks DavisSee 780e4b0a90eSBrooks Davis.Xr geom 8 . 781e4b0a90eSBrooks Davis.It Cm load 782e4b0a90eSBrooks DavisSee 783e4b0a90eSBrooks Davis.Xr geom 8 . 784e4b0a90eSBrooks Davis.It Cm unload 785e4b0a90eSBrooks DavisSee 786e4b0a90eSBrooks Davis.Xr geom 8 . 787e4b0a90eSBrooks Davis.El 788e4b0a90eSBrooks Davis.Pp 789e4b0a90eSBrooks DavisAdditional options include: 790e4b0a90eSBrooks Davis.Bl -tag -width ".Fl v" 791e4b0a90eSBrooks Davis.It Fl v 792e4b0a90eSBrooks DavisBe more verbose. 793e4b0a90eSBrooks Davis.El 794e4b0a90eSBrooks Davis.Sh KEY SUMMARY 795e4b0a90eSBrooks Davis.Ss Master Key 796e4b0a90eSBrooks DavisUpon 797e4b0a90eSBrooks Davis.Cm init , 798e4b0a90eSBrooks Davisthe 799e4b0a90eSBrooks Davis.Nm 800e4b0a90eSBrooks Davisutility generates a random Master Key for the provider. 801e4b0a90eSBrooks DavisThe Master Key never changes during the lifetime of the provider. 802e4b0a90eSBrooks DavisEach copy of the provider metadata, active or backed up to a file, can store 803e4b0a90eSBrooks Davisup to two, independently-encrypted copies of the Master Key. 804e4b0a90eSBrooks Davis.Ss User Key 805e4b0a90eSBrooks DavisEach stored copy of the Master Key is encrypted with a User Key, which 806e4b0a90eSBrooks Davisis generated by the 807e4b0a90eSBrooks Davis.Nm 808e4b0a90eSBrooks Davisutility from a passphrase and/or a keyfile. 809e4b0a90eSBrooks DavisThe 810e4b0a90eSBrooks Davis.Nm 811e4b0a90eSBrooks Davisutility first reads all parts of the keyfile in the order specified on the 812e4b0a90eSBrooks Daviscommand line, then reads all parts of the stored passphrase in the order 813e4b0a90eSBrooks Davisspecified on the command line. 814e4b0a90eSBrooks DavisIf no passphrase parts are specified, the system prompts the user to enter 815e4b0a90eSBrooks Davisthe passphrase. 816e4b0a90eSBrooks DavisThe passphrase is optionally strengthened by PKCS#5v2. 817e4b0a90eSBrooks DavisThe User Key is a digest computed over the concatenated keyfile and passphrase. 818e4b0a90eSBrooks Davis.Ss Data Key 819e4b0a90eSBrooks DavisDuring operation, one or more Data Keys are deterministically derived by 820e4b0a90eSBrooks Davisthe kernel from the Master Key and cached in memory. 821e4b0a90eSBrooks DavisThe number of Data Keys used by a given provider, and the way they are 822e4b0a90eSBrooks Davisderived, depend on the GELI version and whether the provider is configured to 823e4b0a90eSBrooks Davisuse data authentication. 824e4b0a90eSBrooks Davis.Sh SYSCTL VARIABLES 825e4b0a90eSBrooks DavisThe following 826e4b0a90eSBrooks Davis.Xr sysctl 8 827e4b0a90eSBrooks Davisvariables can be used to control the behavior of the 828e4b0a90eSBrooks Davis.Nm ELI 829e4b0a90eSBrooks DavisGEOM class. 830e4b0a90eSBrooks DavisThe default value is shown next to each variable. 831e4b0a90eSBrooks DavisSome variables can also be set in 832e4b0a90eSBrooks Davis.Pa /boot/loader.conf . 833e4b0a90eSBrooks Davis.Bl -tag -width indent 834e4b0a90eSBrooks Davis.It Va kern.geom.eli.version 835e4b0a90eSBrooks DavisVersion number of the 836e4b0a90eSBrooks Davis.Nm ELI 837e4b0a90eSBrooks DavisGEOM class. 838e4b0a90eSBrooks Davis.It Va kern.geom.eli.debug : No 0 839e4b0a90eSBrooks DavisDebug level of the 840e4b0a90eSBrooks Davis.Nm ELI 841e4b0a90eSBrooks DavisGEOM class. 842e4b0a90eSBrooks DavisThis can be set to a number between 0 and 3 inclusive. 843e4b0a90eSBrooks DavisIf set to 0, minimal debug information is printed. 844e4b0a90eSBrooks DavisIf set to 3, the 845e4b0a90eSBrooks Davismaximum amount of debug information is printed. 846e4b0a90eSBrooks Davis.It Va kern.geom.eli.tries : No 3 847e4b0a90eSBrooks DavisNumber of times a user is asked for the passphrase. 848217df2daSBen WoodsThis is only used for providers which are attached on boot, 849217df2daSBen Woodsbefore the root filesystem is mounted. 850e4b0a90eSBrooks DavisIf set to 0, attaching providers on boot will be disabled. 851e4b0a90eSBrooks DavisThis variable should be set in 852e4b0a90eSBrooks Davis.Pa /boot/loader.conf . 853e4b0a90eSBrooks Davis.It Va kern.geom.eli.overwrites : No 5 854217df2daSBen WoodsSpecifies how many times the Master Key is overwritten 855e4b0a90eSBrooks Daviswith random values when it is destroyed. 856e4b0a90eSBrooks DavisAfter this operation it is filled with zeros. 857e4b0a90eSBrooks Davis.It Va kern.geom.eli.visible_passphrase : No 0 858217df2daSBen WoodsIf set to 1, the passphrase entered on boot will be visible. 859e4b0a90eSBrooks DavisThis alternative should be used with caution as the entered 860e4b0a90eSBrooks Davispassphrase can be logged and exposed via 861e4b0a90eSBrooks Davis.Xr dmesg 8 . 862e4b0a90eSBrooks DavisThis variable should be set in 863e4b0a90eSBrooks Davis.Pa /boot/loader.conf . 864e4b0a90eSBrooks Davis.It Va kern.geom.eli.threads : No 0 865e4b0a90eSBrooks DavisSpecifies how many kernel threads should be used for doing software 866e4b0a90eSBrooks Daviscryptography. 867e4b0a90eSBrooks DavisIts purpose is to increase performance on SMP systems. 868e4b0a90eSBrooks DavisIf set to 0, a CPU-pinned thread will be started for every active CPU. 869e4b0a90eSBrooks Davis.It Va kern.geom.eli.batch : No 0 870e4b0a90eSBrooks DavisWhen set to 1, can speed-up crypto operations by using batching. 871e4b0a90eSBrooks DavisBatching reduces the number of interrupts by responding to a group of 872e4b0a90eSBrooks Daviscrypto requests with one interrupt. 873e4b0a90eSBrooks DavisThe crypto card and the driver has to support this feature. 874e4b0a90eSBrooks Davis.It Va kern.geom.eli.key_cache_limit : No 8192 875e4b0a90eSBrooks DavisSpecifies how many Data Keys to cache. 876e4b0a90eSBrooks DavisThe default limit 877e4b0a90eSBrooks Davis(8192 keys) will allow caching of all keys for a 4TB provider with 512 byte 878e4b0a90eSBrooks Davissectors and will take around 1MB of memory. 879e4b0a90eSBrooks Davis.It Va kern.geom.eli.key_cache_hits 880e4b0a90eSBrooks DavisReports how many times we were looking up a Data Key and it was already in 881e4b0a90eSBrooks Daviscache. 882e4b0a90eSBrooks DavisThis sysctl is not updated for providers that need fewer Data Keys than 883e4b0a90eSBrooks Davisthe limit specified in 884e4b0a90eSBrooks Davis.Va kern.geom.eli.key_cache_limit . 885e4b0a90eSBrooks Davis.It Va kern.geom.eli.key_cache_misses 886e4b0a90eSBrooks DavisReports how many times we were looking up a Data Key and it was not in cache. 887e4b0a90eSBrooks DavisThis sysctl is not updated for providers that need fewer Data Keys than the limit 888e4b0a90eSBrooks Davisspecified in 889e4b0a90eSBrooks Davis.Va kern.geom.eli.key_cache_limit . 890e4b0a90eSBrooks Davis.El 891e4b0a90eSBrooks Davis.Sh EXIT STATUS 892e4b0a90eSBrooks DavisExit status is 0 on success, and 1 if the command fails. 893e4b0a90eSBrooks Davis.Sh EXAMPLES 894e4b0a90eSBrooks DavisInitialize a provider which is going to be encrypted with a 895e4b0a90eSBrooks Davispassphrase and random data from a file on the user's pen drive. 896e4b0a90eSBrooks DavisUse 4kB sector size. 897e4b0a90eSBrooks DavisAttach the provider, create a filesystem, and mount it. 898e4b0a90eSBrooks DavisDo the work. 899e4b0a90eSBrooks DavisUnmount the provider and detach it: 900e4b0a90eSBrooks Davis.Bd -literal -offset indent 901e4b0a90eSBrooks Davis# dd if=/dev/random of=/mnt/pendrive/da2.key bs=64 count=1 902e4b0a90eSBrooks Davis# geli init -s 4096 -K /mnt/pendrive/da2.key /dev/da2 903e4b0a90eSBrooks DavisEnter new passphrase: 904e4b0a90eSBrooks DavisReenter new passphrase: 905e4b0a90eSBrooks Davis# geli attach -k /mnt/pendrive/da2.key /dev/da2 906e4b0a90eSBrooks DavisEnter passphrase: 907e4b0a90eSBrooks Davis# dd if=/dev/random of=/dev/da2.eli bs=1m 908e4b0a90eSBrooks Davis# newfs /dev/da2.eli 909e4b0a90eSBrooks Davis# mount /dev/da2.eli /mnt/secret 910e4b0a90eSBrooks Davis\&... 911e4b0a90eSBrooks Davis# umount /mnt/secret 912e4b0a90eSBrooks Davis# geli detach da2.eli 913e4b0a90eSBrooks Davis.Ed 914e4b0a90eSBrooks Davis.Pp 915e4b0a90eSBrooks DavisCreate an encrypted provider, but use two User Keys: 916e4b0a90eSBrooks Davisone for your employee and one for you as the company's security officer 917e4b0a90eSBrooks Davis(so it is not a tragedy if the employee 918e4b0a90eSBrooks Davis.Qq accidentally 919e4b0a90eSBrooks Davisforgets his passphrase): 920e4b0a90eSBrooks Davis.Bd -literal -offset indent 921e4b0a90eSBrooks Davis# geli init /dev/da2 922e4b0a90eSBrooks DavisEnter new passphrase: (enter security officer's passphrase) 923e4b0a90eSBrooks DavisReenter new passphrase: 924e4b0a90eSBrooks Davis# geli setkey -n 1 /dev/da2 925e4b0a90eSBrooks DavisEnter passphrase: (enter security officer's passphrase) 926e4b0a90eSBrooks DavisEnter new passphrase: (let your employee enter his passphrase ...) 927e4b0a90eSBrooks DavisReenter new passphrase: (... twice) 928e4b0a90eSBrooks Davis.Ed 929e4b0a90eSBrooks Davis.Pp 930e4b0a90eSBrooks DavisYou are the security officer in your company. 931e4b0a90eSBrooks DavisCreate an encrypted provider for use by the user, but remember that users 932e4b0a90eSBrooks Davisforget their passphrases, so backup the Master Key with your own random key: 933e4b0a90eSBrooks Davis.Bd -literal -offset indent 934e4b0a90eSBrooks Davis# dd if=/dev/random of=/mnt/pendrive/keys/`hostname` bs=64 count=1 935e4b0a90eSBrooks Davis# geli init -P -K /mnt/pendrive/keys/`hostname` /dev/ada0s1e 936e4b0a90eSBrooks Davis# geli backup /dev/ada0s1e /mnt/pendrive/backups/`hostname` 937e4b0a90eSBrooks Davis(use key number 0, so the encrypted Master Key will be re-encrypted by this) 938e4b0a90eSBrooks Davis# geli setkey -n 0 -k /mnt/pendrive/keys/`hostname` /dev/ada0s1e 939e4b0a90eSBrooks Davis(allow the user to enter his passphrase) 940e4b0a90eSBrooks DavisEnter new passphrase: 941e4b0a90eSBrooks DavisReenter new passphrase: 942e4b0a90eSBrooks Davis.Ed 943e4b0a90eSBrooks Davis.Pp 944e4b0a90eSBrooks DavisEncrypted swap partition setup: 945e4b0a90eSBrooks Davis.Bd -literal -offset indent 946e4b0a90eSBrooks Davis# dd if=/dev/random of=/dev/ada0s1b bs=1m 947*e2b99193SJohn Baldwin# geli onetime -d ada0s1b 948e4b0a90eSBrooks Davis# swapon /dev/ada0s1b.eli 949e4b0a90eSBrooks Davis.Ed 950e4b0a90eSBrooks Davis.Pp 951e4b0a90eSBrooks DavisThe example below shows how to configure two providers which will be attached 952217df2daSBen Woodson boot, before the root filesystem is mounted. 953e4b0a90eSBrooks DavisOne of them is using passphrase and three keyfile parts and the other is 954e4b0a90eSBrooks Davisusing only a keyfile in one part: 955e4b0a90eSBrooks Davis.Bd -literal -offset indent 956e4b0a90eSBrooks Davis# dd if=/dev/random of=/dev/da0 bs=1m 957e4b0a90eSBrooks Davis# dd if=/dev/random of=/boot/keys/da0.key0 bs=32k count=1 958e4b0a90eSBrooks Davis# dd if=/dev/random of=/boot/keys/da0.key1 bs=32k count=1 959e4b0a90eSBrooks Davis# dd if=/dev/random of=/boot/keys/da0.key2 bs=32k count=1 960e4b0a90eSBrooks Davis# geli init -b -K /boot/keys/da0.key0 -K /boot/keys/da0.key1 -K /boot/keys/da0.key2 da0 961e4b0a90eSBrooks DavisEnter new passphrase: 962e4b0a90eSBrooks DavisReenter new passphrase: 963e4b0a90eSBrooks Davis# dd if=/dev/random of=/dev/da1s3a bs=1m 964e4b0a90eSBrooks Davis# dd if=/dev/random of=/boot/keys/da1s3a.key bs=128k count=1 965e4b0a90eSBrooks Davis# geli init -b -P -K /boot/keys/da1s3a.key da1s3a 966e4b0a90eSBrooks Davis.Ed 967e4b0a90eSBrooks Davis.Pp 968e4b0a90eSBrooks DavisThe providers are initialized, now we have to add these lines to 969e4b0a90eSBrooks Davis.Pa /boot/loader.conf : 970e4b0a90eSBrooks Davis.Bd -literal -offset indent 971e4b0a90eSBrooks Davisgeli_da0_keyfile0_load="YES" 972e4b0a90eSBrooks Davisgeli_da0_keyfile0_type="da0:geli_keyfile0" 973e4b0a90eSBrooks Davisgeli_da0_keyfile0_name="/boot/keys/da0.key0" 974e4b0a90eSBrooks Davisgeli_da0_keyfile1_load="YES" 975e4b0a90eSBrooks Davisgeli_da0_keyfile1_type="da0:geli_keyfile1" 976e4b0a90eSBrooks Davisgeli_da0_keyfile1_name="/boot/keys/da0.key1" 977e4b0a90eSBrooks Davisgeli_da0_keyfile2_load="YES" 978e4b0a90eSBrooks Davisgeli_da0_keyfile2_type="da0:geli_keyfile2" 979e4b0a90eSBrooks Davisgeli_da0_keyfile2_name="/boot/keys/da0.key2" 980e4b0a90eSBrooks Davis 981e4b0a90eSBrooks Davisgeli_da1s3a_keyfile0_load="YES" 982e4b0a90eSBrooks Davisgeli_da1s3a_keyfile0_type="da1s3a:geli_keyfile0" 983e4b0a90eSBrooks Davisgeli_da1s3a_keyfile0_name="/boot/keys/da1s3a.key" 984e4b0a90eSBrooks Davis.Ed 985e4b0a90eSBrooks Davis.Pp 986e4b0a90eSBrooks DavisIf there is only one keyfile, the index might be omitted: 987e4b0a90eSBrooks Davis.Bd -literal -offset indent 988e4b0a90eSBrooks Davisgeli_da1s3a_keyfile_load="YES" 989e4b0a90eSBrooks Davisgeli_da1s3a_keyfile_type="da1s3a:geli_keyfile" 990e4b0a90eSBrooks Davisgeli_da1s3a_keyfile_name="/boot/keys/da1s3a.key" 991e4b0a90eSBrooks Davis.Ed 992e4b0a90eSBrooks Davis.Pp 9939168ef5bSMateusz PiotrowskiBy convention, these loader variables are called 9949168ef5bSMateusz Piotrowski.Sm off 9959168ef5bSMateusz Piotrowski.Va geli_ No < Ar device No > Va _load . 9969168ef5bSMateusz Piotrowski.Sm on 9979168ef5bSMateusz PiotrowskiHowever, the actual name prefix before 9989168ef5bSMateusz Piotrowski.Va _load , _type , 9999168ef5bSMateusz Piotrowskior 10009168ef5bSMateusz Piotrowski.Va _name 10019168ef5bSMateusz Piotrowskidoes not matter. 10029168ef5bSMateusz PiotrowskiAt boot time, the 10039168ef5bSMateusz Piotrowski.Nm 10049168ef5bSMateusz Piotrowskimodule searches through all 10059168ef5bSMateusz Piotrowski.Sm off 10069168ef5bSMateusz Piotrowski.No < Va prefix No > Va _type No -like 10079168ef5bSMateusz Piotrowski.Sm on 10089168ef5bSMateusz Piotrowskivariables that have a value of 10099168ef5bSMateusz Piotrowski.Sm off 10109168ef5bSMateusz Piotrowski.Dq < Ar device No > :geli_keyfile . 10119168ef5bSMateusz Piotrowski.Sm on 10129168ef5bSMateusz PiotrowskiThe paths to keyfiles are then extracted from 10139168ef5bSMateusz Piotrowski.Sm off 10149168ef5bSMateusz Piotrowski.No < Ar prefix No > Va _name 10159168ef5bSMateusz Piotrowski.Sm on 10169168ef5bSMateusz Piotrowskivariables. 10179168ef5bSMateusz PiotrowskiIn the example above, 10189168ef5bSMateusz Piotrowski.Ar prefix 10199168ef5bSMateusz Piotrowskiis 10209168ef5bSMateusz Piotrowski.Dq Li geli_da1s3a_keyfile . 10219168ef5bSMateusz Piotrowski.Pp 1022e4b0a90eSBrooks DavisNot only configure encryption, but also data integrity verification using 1023e4b0a90eSBrooks Davis.Nm HMAC/SHA256 . 1024e4b0a90eSBrooks Davis.Bd -literal -offset indent 1025e4b0a90eSBrooks Davis# geli init -a hmac/sha256 -s 4096 /dev/da0 1026e4b0a90eSBrooks DavisEnter new passphrase: 1027e4b0a90eSBrooks DavisReenter new passphrase: 1028e4b0a90eSBrooks Davis# geli attach /dev/da0 1029e4b0a90eSBrooks DavisEnter passphrase: 1030e4b0a90eSBrooks Davis# dd if=/dev/random of=/dev/da0.eli bs=1m 1031e4b0a90eSBrooks Davis# newfs /dev/da0.eli 1032e4b0a90eSBrooks Davis# mount /dev/da0.eli /mnt/secret 1033e4b0a90eSBrooks Davis.Ed 1034e4b0a90eSBrooks Davis.Pp 1035e4b0a90eSBrooks Davis.Cm geli 1036e4b0a90eSBrooks Daviswrites the metadata backup by default to the 1037e4b0a90eSBrooks Davis.Pa /var/backups/<prov>.eli 1038e4b0a90eSBrooks Davisfile. 1039e4b0a90eSBrooks DavisIf the metadata is lost in any way (e.g., by accidental overwrite), it can be restored. 1040e4b0a90eSBrooks DavisConsider the following situation: 1041e4b0a90eSBrooks Davis.Bd -literal -offset indent 1042e4b0a90eSBrooks Davis# geli init /dev/da0 1043e4b0a90eSBrooks DavisEnter new passphrase: 1044e4b0a90eSBrooks DavisReenter new passphrase: 1045e4b0a90eSBrooks Davis 1046e4b0a90eSBrooks DavisMetadata backup can be found in /var/backups/da0.eli and 1047e4b0a90eSBrooks Daviscan be restored with the following command: 1048e4b0a90eSBrooks Davis 1049e4b0a90eSBrooks Davis # geli restore /var/backups/da0.eli /dev/da0 1050e4b0a90eSBrooks Davis 1051e4b0a90eSBrooks Davis# geli clear /dev/da0 1052e4b0a90eSBrooks Davis# geli attach /dev/da0 1053e4b0a90eSBrooks Davisgeli: Cannot read metadata from /dev/da0: Invalid argument. 1054e4b0a90eSBrooks Davis# geli restore /var/backups/da0.eli /dev/da0 1055e4b0a90eSBrooks Davis# geli attach /dev/da0 1056e4b0a90eSBrooks DavisEnter passphrase: 1057e4b0a90eSBrooks Davis.Ed 1058e4b0a90eSBrooks Davis.Pp 1059e4b0a90eSBrooks DavisIf an encrypted filesystem is extended, it is necessary to relocate and 1060e4b0a90eSBrooks Davisupdate the metadata: 1061e4b0a90eSBrooks Davis.Bd -literal -offset indent 1062e4b0a90eSBrooks Davis# gpart create -s GPT ada0 1063e4b0a90eSBrooks Davis# gpart add -s 1g -t freebsd-ufs -i 1 ada0 1064e4b0a90eSBrooks Davis# geli init -K keyfile -P ada0p1 1065e4b0a90eSBrooks Davis# gpart resize -s 2g -i 1 ada0 1066e4b0a90eSBrooks Davis# geli resize -s 1g ada0p1 1067e4b0a90eSBrooks Davis# geli attach -k keyfile -p ada0p1 1068e4b0a90eSBrooks Davis.Ed 1069e4b0a90eSBrooks Davis.Pp 1070e4b0a90eSBrooks DavisInitialize provider with the passphrase split into two files. 1071e4b0a90eSBrooks DavisThe provider can be attached using those two files or by entering 1072e4b0a90eSBrooks Davis.Dq foobar 1073e4b0a90eSBrooks Davisas the passphrase at the 1074e4b0a90eSBrooks Davis.Nm 1075e4b0a90eSBrooks Davisprompt: 1076e4b0a90eSBrooks Davis.Bd -literal -offset indent 1077e4b0a90eSBrooks Davis# echo foo > da0.pass0 1078e4b0a90eSBrooks Davis# echo bar > da0.pass1 1079e4b0a90eSBrooks Davis# geli init -J da0.pass0 -J da0.pass1 da0 1080e4b0a90eSBrooks Davis# geli attach -j da0.pass0 -j da0.pass1 da0 1081e4b0a90eSBrooks Davis# geli detach da0 1082e4b0a90eSBrooks Davis# geli attach da0 1083e4b0a90eSBrooks DavisEnter passphrase: foobar 1084e4b0a90eSBrooks Davis.Ed 1085e4b0a90eSBrooks Davis.Pp 1086e4b0a90eSBrooks DavisSuspend all 1087e4b0a90eSBrooks Davis.Nm 1088e4b0a90eSBrooks Davisdevices on a laptop, suspend the laptop, then resume devices one by one after 1089e4b0a90eSBrooks Davisresuming the laptop: 1090e4b0a90eSBrooks Davis.Bd -literal -offset indent 1091e4b0a90eSBrooks Davis# geli suspend -a 1092e4b0a90eSBrooks Davis# zzz 1093e4b0a90eSBrooks Davis<resume your laptop> 1094e4b0a90eSBrooks Davis# geli resume -p -k keyfile gpt/secret 1095e4b0a90eSBrooks Davis# geli resume gpt/private 1096e4b0a90eSBrooks DavisEnter passphrase: 1097e4b0a90eSBrooks Davis.Ed 1098e4b0a90eSBrooks Davis.Sh ENCRYPTION MODES 1099e4b0a90eSBrooks Davis.Nm 1100e4b0a90eSBrooks Davissupports two encryption modes: 1101e4b0a90eSBrooks Davis.Nm XTS , 1102e4b0a90eSBrooks Daviswhich was standardized as 1103e4b0a90eSBrooks Davis.Nm IEEE P1619 1104e4b0a90eSBrooks Davisand 1105e4b0a90eSBrooks Davis.Nm CBC 1106e4b0a90eSBrooks Daviswith unpredictable IV. 1107e4b0a90eSBrooks DavisThe 1108e4b0a90eSBrooks Davis.Nm CBC 1109e4b0a90eSBrooks Davismode used by 1110e4b0a90eSBrooks Davis.Nm 1111e4b0a90eSBrooks Davisis very similar to the mode 1112e4b0a90eSBrooks Davis.Nm ESSIV . 1113e4b0a90eSBrooks Davis.Sh DATA AUTHENTICATION 1114e4b0a90eSBrooks Davis.Nm 1115e4b0a90eSBrooks Daviscan verify data integrity when an authentication algorithm is specified. 1116e4b0a90eSBrooks DavisWhen data corruption/modification is detected, 1117e4b0a90eSBrooks Davis.Nm 1118e4b0a90eSBrooks Daviswill not return any data, but instead will return an error 1119e4b0a90eSBrooks Davis.Pq Er EINVAL . 1120e4b0a90eSBrooks DavisThe offset and size of the corrupted data will be printed on the console. 1121e4b0a90eSBrooks DavisIt is important to know against which attacks 1122e4b0a90eSBrooks Davis.Nm 1123e4b0a90eSBrooks Davisprovides protection for your data. 1124e4b0a90eSBrooks DavisIf data is modified in-place or copied from one place on the disk 1125e4b0a90eSBrooks Davisto another even without modification, 1126e4b0a90eSBrooks Davis.Nm 1127e4b0a90eSBrooks Davisshould be able to detect such a change. 1128e4b0a90eSBrooks DavisIf an attacker can remember the encrypted data, he can overwrite any future 1129e4b0a90eSBrooks Davischanges with the data he owns without it being noticed. 1130e4b0a90eSBrooks DavisIn other words 1131e4b0a90eSBrooks Davis.Nm 1132e4b0a90eSBrooks Daviswill not protect your data against replay attacks. 1133e4b0a90eSBrooks Davis.Pp 1134e4b0a90eSBrooks DavisIt is recommended to write to the whole provider before first use, 1135e4b0a90eSBrooks Davisin order to make sure that all sectors and their corresponding 1136e4b0a90eSBrooks Davischecksums are properly initialized into a consistent state. 1137e4b0a90eSBrooks DavisOne can safely ignore data authentication errors that occur immediately 1138e4b0a90eSBrooks Davisafter the first time a provider is attached and before it is 1139e4b0a90eSBrooks Davisinitialized in this way. 1140e4b0a90eSBrooks Davis.Sh SEE ALSO 1141e4b0a90eSBrooks Davis.Xr crypto 4 , 1142e4b0a90eSBrooks Davis.Xr gbde 4 , 1143e4b0a90eSBrooks Davis.Xr geom 4 , 1144e4b0a90eSBrooks Davis.Xr loader.conf 5 , 1145e4b0a90eSBrooks Davis.Xr gbde 8 , 1146e4b0a90eSBrooks Davis.Xr geom 8 , 1147e4b0a90eSBrooks Davis.Xr crypto 9 1148e4b0a90eSBrooks Davis.Sh HISTORY 1149e4b0a90eSBrooks DavisThe 1150e4b0a90eSBrooks Davis.Nm 1151e4b0a90eSBrooks Davisutility appeared in 1152e4b0a90eSBrooks Davis.Fx 6.0 . 1153e4b0a90eSBrooks DavisSupport for the 1154e4b0a90eSBrooks Davis.Nm Camellia 11555c420aaeSJohn Baldwinblock cipher was implemented by Yoshisato Yanagisawa in 1156e4b0a90eSBrooks Davis.Fx 7.0 . 1157e4b0a90eSBrooks Davis.Pp 1158e4b0a90eSBrooks DavisHighest 1159e4b0a90eSBrooks Davis.Nm GELI 1160e4b0a90eSBrooks Davismetadata version supported by the given FreeBSD version: 1161e4b0a90eSBrooks Davis.Bl -column -offset indent ".Sy FreeBSD" ".Sy version" 1162e4b0a90eSBrooks Davis.It Sy FreeBSD Ta Sy GELI 1163e4b0a90eSBrooks Davis.It Sy version Ta Sy version 1164e4b0a90eSBrooks Davis.Pp 1165e4b0a90eSBrooks Davis.It Li 6.0 Ta 0 1166e4b0a90eSBrooks Davis.It Li 6.1 Ta 0 1167e4b0a90eSBrooks Davis.It Li 6.2 Ta 3 1168e4b0a90eSBrooks Davis.It Li 6.3 Ta 3 1169e4b0a90eSBrooks Davis.It Li 6.4 Ta 3 1170e4b0a90eSBrooks Davis.Pp 1171e4b0a90eSBrooks Davis.It Li 7.0 Ta 3 1172e4b0a90eSBrooks Davis.It Li 7.1 Ta 3 1173e4b0a90eSBrooks Davis.It Li 7.2 Ta 3 1174e4b0a90eSBrooks Davis.It Li 7.3 Ta 3 1175e4b0a90eSBrooks Davis.It Li 7.4 Ta 3 1176e4b0a90eSBrooks Davis.Pp 1177e4b0a90eSBrooks Davis.It Li 8.0 Ta 3 1178e4b0a90eSBrooks Davis.It Li 8.1 Ta 3 1179e4b0a90eSBrooks Davis.It Li 8.2 Ta 5 1180e4b0a90eSBrooks Davis.Pp 1181e4b0a90eSBrooks Davis.It Li 9.0 Ta 6 1182e4b0a90eSBrooks Davis.Pp 1183e4b0a90eSBrooks Davis.It Li 10.0 Ta 7 1184e4b0a90eSBrooks Davis.El 1185e4b0a90eSBrooks Davis.Sh AUTHORS 1186e4b0a90eSBrooks Davis.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org 1187