2002-12-12 08:53:20 +00:00
|
|
|
.\"
|
2002-10-20 11:16:13 +00:00
|
|
|
.\" Copyright (c) 2002 Poul-Henning Kamp
|
|
|
|
.\" Copyright (c) 2002 Networks Associates Technology, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This software was developed for the FreeBSD Project by Poul-Henning Kamp
|
|
|
|
.\" and NAI Labs, the Security Research Division of Network Associates, Inc.
|
|
|
|
.\" under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
|
|
|
|
.\" DARPA CHATS research program.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
2002-12-12 08:53:20 +00:00
|
|
|
.\"
|
2016-10-02 23:48:33 +00:00
|
|
|
.Dd October 3, 2016
|
2002-12-12 08:53:20 +00:00
|
|
|
.Dt GBDE 8
|
2002-10-20 11:16:13 +00:00
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm gbde
|
2002-12-12 08:53:20 +00:00
|
|
|
.Nd operation and management utility for Geom Based Disk Encryption
|
2002-10-20 11:16:13 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2002-10-20 19:20:26 +00:00
|
|
|
.Cm attach
|
2002-10-20 11:16:13 +00:00
|
|
|
.Ar destination
|
2006-02-08 06:52:15 +00:00
|
|
|
.Op Fl k Ar keyfile
|
2002-10-20 11:16:13 +00:00
|
|
|
.Op Fl l Ar lockfile
|
|
|
|
.Op Fl p Ar pass-phrase
|
|
|
|
.Nm
|
2002-10-20 19:20:26 +00:00
|
|
|
.Cm detach
|
2002-10-20 11:16:13 +00:00
|
|
|
.Ar destination
|
|
|
|
.Nm
|
2002-10-20 19:20:26 +00:00
|
|
|
.Cm init
|
2002-10-20 11:16:13 +00:00
|
|
|
.Ar destination
|
|
|
|
.Op Fl i
|
|
|
|
.Op Fl f Ar filename
|
2006-02-08 06:52:15 +00:00
|
|
|
.Op Fl K Ar new-keyfile
|
2005-02-12 21:47:05 +00:00
|
|
|
.Op Fl L Ar new-lockfile
|
|
|
|
.Op Fl P Ar new-pass-phrase
|
2002-10-20 11:16:13 +00:00
|
|
|
.Nm
|
2002-10-20 19:20:26 +00:00
|
|
|
.Cm setkey
|
2002-10-20 11:16:13 +00:00
|
|
|
.Ar destination
|
|
|
|
.Op Fl n Ar key
|
2006-02-08 06:52:15 +00:00
|
|
|
.Op Fl k Ar keyfile
|
2002-10-20 11:16:13 +00:00
|
|
|
.Op Fl l Ar lockfile
|
|
|
|
.Op Fl p Ar pass-phrase
|
2006-02-08 06:52:15 +00:00
|
|
|
.Op Fl K Ar new-keyfile
|
2002-10-20 11:16:13 +00:00
|
|
|
.Op Fl L Ar new-lockfile
|
|
|
|
.Op Fl P Ar new-pass-phrase
|
|
|
|
.Nm
|
2005-02-12 21:47:05 +00:00
|
|
|
.Cm nuke
|
2002-10-20 11:16:13 +00:00
|
|
|
.Ar destination
|
|
|
|
.Op Fl n Ar key
|
2006-02-08 06:52:15 +00:00
|
|
|
.Op Fl k Ar keyfile
|
2002-10-20 11:16:13 +00:00
|
|
|
.Op Fl l Ar lockfile
|
2002-11-04 09:27:01 +00:00
|
|
|
.Op Fl p Ar pass-phrase
|
2005-02-12 21:47:05 +00:00
|
|
|
.Nm
|
|
|
|
.Cm destroy
|
|
|
|
.Ar destination
|
2006-02-08 06:52:15 +00:00
|
|
|
.Op Fl k Ar keyfile
|
2005-02-12 21:47:05 +00:00
|
|
|
.Op Fl l Ar lockfile
|
|
|
|
.Op Fl p Ar pass-phrase
|
2002-11-18 22:56:41 +00:00
|
|
|
.Sh DESCRIPTION
|
2002-12-12 08:53:20 +00:00
|
|
|
.Bf -symbolic
|
2002-11-18 22:56:41 +00:00
|
|
|
NOTICE:
|
2002-11-04 09:27:01 +00:00
|
|
|
Please be aware that this code has not yet received much review
|
|
|
|
and analysis by qualified cryptographers and therefore should be considered
|
|
|
|
a slightly suspect experimental facility.
|
|
|
|
.Pp
|
|
|
|
We cannot at this point guarantee that the on-disk format will not change
|
2002-12-01 15:57:02 +00:00
|
|
|
in response to reviews or bug-fixes, so potential users are advised to
|
2002-11-04 09:27:01 +00:00
|
|
|
be prepared that
|
2002-11-18 22:56:41 +00:00
|
|
|
.Xr dump 8 Ns / Ns
|
2002-11-04 09:27:01 +00:00
|
|
|
.Xr restore 8
|
|
|
|
based migrations may be called for in the future.
|
2002-11-18 22:56:41 +00:00
|
|
|
.Ef
|
|
|
|
.Pp
|
|
|
|
The
|
2002-10-20 11:16:13 +00:00
|
|
|
.Nm
|
2002-12-12 08:53:20 +00:00
|
|
|
utility is the only official operation and management interface for the
|
2002-10-20 11:16:13 +00:00
|
|
|
.Xr gbde 4
|
2002-12-12 08:53:20 +00:00
|
|
|
.Tn GEOM
|
|
|
|
based disk encryption kernel facility.
|
2002-10-20 11:16:13 +00:00
|
|
|
The interaction between the
|
|
|
|
.Nm
|
2002-12-12 08:53:20 +00:00
|
|
|
utility and the kernel part is not a published interface.
|
2002-10-20 11:16:13 +00:00
|
|
|
.Pp
|
2002-10-20 19:20:26 +00:00
|
|
|
The operational aspect consists of two subcommands:
|
2002-12-12 08:53:20 +00:00
|
|
|
one to open and attach
|
|
|
|
a device to the in-kernel cryptographic
|
|
|
|
.Nm
|
2005-02-12 21:47:05 +00:00
|
|
|
module
|
|
|
|
.Pq Cm attach ,
|
|
|
|
and one to close and detach a device
|
|
|
|
.Pq Cm detach .
|
2002-10-20 11:16:13 +00:00
|
|
|
.Pp
|
|
|
|
The management part allows initialization of the master key and lock sectors
|
2005-02-12 21:47:05 +00:00
|
|
|
on a device
|
|
|
|
.Pq Cm init ,
|
|
|
|
initialization and replacement of pass-phrases
|
|
|
|
.Pq Cm setkey ,
|
|
|
|
and key invalidation
|
|
|
|
.Pq Cm nuke
|
|
|
|
and blackening
|
|
|
|
.Pq Cm destroy
|
|
|
|
functions.
|
2002-10-20 11:16:13 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl l Ar lockfile
|
|
|
|
argument is used to supply the lock selector data.
|
|
|
|
If no
|
|
|
|
.Fl l
|
2002-10-20 19:20:26 +00:00
|
|
|
option is specified, the first sector is used for this purpose.
|
2002-10-20 11:16:13 +00:00
|
|
|
.Pp
|
2002-10-20 19:20:26 +00:00
|
|
|
The
|
2002-10-20 11:16:13 +00:00
|
|
|
.Fl L Ar new-lockfile
|
2002-10-20 19:20:26 +00:00
|
|
|
argument
|
2005-02-12 21:47:05 +00:00
|
|
|
specifies the lock selector file for the key
|
|
|
|
initialized with the
|
|
|
|
.Cm init
|
|
|
|
subcommand
|
|
|
|
or modified with the
|
2002-12-12 08:53:20 +00:00
|
|
|
.Cm setkey
|
|
|
|
subcommand.
|
2002-10-20 11:16:13 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl n Ar key
|
2002-12-01 15:57:02 +00:00
|
|
|
argument can be used to specify to which of the four keys
|
|
|
|
the operation applies.
|
2002-10-20 19:20:26 +00:00
|
|
|
A value of 1 to 4 selects the specified key, a value of 0 (the default)
|
|
|
|
means
|
|
|
|
.Dq "this key"
|
|
|
|
(i.e., the key used to gain access to the device)
|
2002-12-12 08:53:20 +00:00
|
|
|
and a value of \-1 means
|
2002-10-20 19:20:26 +00:00
|
|
|
.Dq "all keys" .
|
2002-10-20 11:16:13 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl f Ar filename
|
|
|
|
specifies an optional parameter file for use under initialization.
|
|
|
|
.Pp
|
2002-10-20 19:20:26 +00:00
|
|
|
Alternatively, the
|
2002-10-20 11:16:13 +00:00
|
|
|
.Fl i
|
2002-10-20 19:20:26 +00:00
|
|
|
option toggles an interactive mode where a template file with descriptions
|
2002-10-20 11:16:13 +00:00
|
|
|
of the parameters can be interactively edited.
|
|
|
|
.Pp
|
2002-10-20 19:20:26 +00:00
|
|
|
The
|
2002-10-20 11:16:13 +00:00
|
|
|
.Fl p Ar pass-phrase
|
2002-10-20 19:20:26 +00:00
|
|
|
argument
|
2002-12-01 15:57:02 +00:00
|
|
|
specifies the pass-phrase used for opening the device.
|
2002-10-20 19:20:26 +00:00
|
|
|
If not specified, the controlling terminal will be used to prompt the user
|
2002-10-20 11:16:13 +00:00
|
|
|
for the pass-phrase.
|
2002-11-18 22:56:41 +00:00
|
|
|
Be aware that using this option may expose the pass-phrase to other
|
2002-11-04 09:27:01 +00:00
|
|
|
users who happen to run
|
2002-11-18 22:56:41 +00:00
|
|
|
.Xr ps 1
|
2002-11-04 09:27:01 +00:00
|
|
|
or similar while the command is running.
|
2002-10-20 11:16:13 +00:00
|
|
|
.Pp
|
2002-10-20 19:20:26 +00:00
|
|
|
The
|
2002-10-20 11:16:13 +00:00
|
|
|
.Fl P Ar new-pass-phrase
|
2002-10-20 19:20:26 +00:00
|
|
|
argument
|
2002-10-20 11:16:13 +00:00
|
|
|
can be used to specify the new pass-phrase to the
|
2002-11-04 09:27:01 +00:00
|
|
|
.Cm init
|
2002-12-12 08:53:20 +00:00
|
|
|
and
|
2002-10-20 19:20:26 +00:00
|
|
|
.Cm setkey
|
2002-11-04 09:27:01 +00:00
|
|
|
subcommands.
|
2002-10-20 11:16:13 +00:00
|
|
|
If not specified, the user is prompted for the new pass-phrase on the
|
|
|
|
controlling terminal.
|
2002-11-18 22:56:41 +00:00
|
|
|
Be aware that using this option may expose the pass-phrase to other
|
2002-11-04 09:27:01 +00:00
|
|
|
users who happen to run
|
2002-11-18 22:56:41 +00:00
|
|
|
.Xr ps 1
|
2002-11-04 09:27:01 +00:00
|
|
|
or similar while the command is running.
|
2006-02-08 06:52:15 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl k Ar keyfile
|
|
|
|
argument specifies a key file to be used in combination with the
|
|
|
|
pass-phrase (whether the pass-phrase is specified on the command line
|
|
|
|
or entered from the terminal) for opening the device.
|
|
|
|
The device will only be opened if the contents of the key file and the
|
|
|
|
pass-phrase are both correct.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl K Ar new-keyfile
|
|
|
|
argument can be used to specify a new key file to the
|
|
|
|
.Cm init
|
|
|
|
and
|
|
|
|
.Cm setkey
|
|
|
|
subcommands.
|
|
|
|
If not specified, no key file will be used (even if one was previously
|
|
|
|
used).
|
2002-10-20 11:16:13 +00:00
|
|
|
.Sh EXAMPLES
|
|
|
|
To initialize a device, using default parameters:
|
2002-12-12 08:53:20 +00:00
|
|
|
.Pp
|
2013-10-01 18:41:53 +00:00
|
|
|
.Dl "gbde init /dev/ada0s1f -L /etc/ada0s1f.lock"
|
2002-10-20 11:16:13 +00:00
|
|
|
.Pp
|
|
|
|
To attach an encrypted device:
|
2002-12-12 08:53:20 +00:00
|
|
|
.Pp
|
2013-10-01 18:41:53 +00:00
|
|
|
.Dl "gbde attach ada0s1f -l /etc/ada0s1f.lock"
|
2002-10-20 11:16:13 +00:00
|
|
|
.Pp
|
2004-05-17 08:35:43 +00:00
|
|
|
The encrypted device has the suffix
|
|
|
|
.Pa .bde
|
|
|
|
so a typical
|
|
|
|
command to create and mount a file system would be:
|
2003-11-27 20:54:51 +00:00
|
|
|
.Pp
|
2013-10-01 18:41:53 +00:00
|
|
|
.Dl "newfs /dev/ada0s1f.bde"
|
|
|
|
.Dl "mount /dev/ada0s1f.bde /secret"
|
2003-11-27 20:54:51 +00:00
|
|
|
.Pp
|
2002-10-20 19:08:56 +00:00
|
|
|
To detach an encrypted device:
|
2002-12-12 08:53:20 +00:00
|
|
|
.Pp
|
2013-10-01 18:41:53 +00:00
|
|
|
.Dl "gbde detach ada0s1f"
|
2002-10-20 11:16:13 +00:00
|
|
|
.Pp
|
2003-11-27 20:54:51 +00:00
|
|
|
Please notice that detaching an encrypted device corresponds to
|
2004-05-17 08:35:43 +00:00
|
|
|
physically removing it, do not forget to unmount the file system first.
|
2003-11-27 20:54:51 +00:00
|
|
|
.Pp
|
2002-10-20 19:08:56 +00:00
|
|
|
To initialize the second key using a detached lockfile and a trivial
|
2002-10-20 11:16:13 +00:00
|
|
|
pass-phrase:
|
2002-12-12 08:53:20 +00:00
|
|
|
.Pp
|
2013-10-01 18:41:53 +00:00
|
|
|
.Dl "gbde setkey ada0s1f -n 2 -P foo -L key2.lockfile"
|
2002-10-20 11:16:13 +00:00
|
|
|
.Pp
|
2014-11-09 15:53:29 +00:00
|
|
|
To invalidate your own masterkey:
|
|
|
|
.Pp
|
|
|
|
.Dl "gbde nuke ada0s1f"
|
|
|
|
.Pp
|
|
|
|
This will overwrite your masterkey sector with zeros, and results in
|
|
|
|
a diagnostic if you try to use the key again.
|
|
|
|
You can also destroy the other three copies of the masterkey with the
|
|
|
|
-n argument.
|
|
|
|
.Pp
|
|
|
|
You can also invalidate your masterkey without leaving a tell-tale sector
|
|
|
|
full of zeros:
|
2002-12-12 08:53:20 +00:00
|
|
|
.Pp
|
2014-08-27 17:44:59 +00:00
|
|
|
.Dl "gbde destroy ada0s1f"
|
2014-11-09 15:53:29 +00:00
|
|
|
.Pp
|
|
|
|
This will overwrite the information fields in your masterkey sector,
|
|
|
|
encrypt it and write it back.
|
|
|
|
You get a (different) diagnostic if you try to use it.
|
2002-10-20 11:16:13 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr gbde 4 ,
|
2002-12-12 08:53:20 +00:00
|
|
|
.Xr geom 4
|
2002-10-20 11:16:13 +00:00
|
|
|
.Sh HISTORY
|
2002-12-12 08:53:20 +00:00
|
|
|
This software was developed for the
|
|
|
|
.Fx
|
|
|
|
Project by
|
2014-06-20 09:40:43 +00:00
|
|
|
.An Poul-Henning Kamp
|
2002-12-12 08:53:20 +00:00
|
|
|
and NAI Labs, the Security Research Division of Network Associates, Inc.\&
|
|
|
|
under DARPA/SPAWAR contract N66001-01-C-8035
|
|
|
|
.Pq Dq CBOSS ,
|
|
|
|
as part of the
|
2002-10-20 11:16:13 +00:00
|
|
|
DARPA CHATS research program.
|
2016-10-02 23:48:33 +00:00
|
|
|
.Nm
|
|
|
|
first appeared in
|
|
|
|
.Fx 5.0 .
|
2002-10-20 11:16:13 +00:00
|
|
|
.Sh AUTHORS
|
2014-06-20 09:40:43 +00:00
|
|
|
.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
|
2002-11-04 09:27:01 +00:00
|
|
|
.Sh BUGS
|
2002-12-01 15:57:02 +00:00
|
|
|
The cryptographic algorithms and the overall design have not been
|
2004-05-23 08:40:52 +00:00
|
|
|
attacked mercilessly for over 10 years by a gang of cryptoanalysts.
|