2002-12-10 14:21:55 +00:00
|
|
|
.\"
|
2002-10-19 21:44:57 +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-10 14:21:55 +00:00
|
|
|
.\"
|
2002-10-19 21:44:57 +00:00
|
|
|
.Dd October 19, 2002
|
2002-12-10 14:21:55 +00:00
|
|
|
.Dt GBDE 4
|
2010-04-14 19:08:06 +00:00
|
|
|
.Os
|
2002-10-19 21:44:57 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm gbde
|
2002-12-10 14:21:55 +00:00
|
|
|
.Nd Geom Based Disk Encryption
|
2002-10-19 21:44:57 +00:00
|
|
|
.Sh SYNOPSIS
|
2002-12-10 14:21:55 +00:00
|
|
|
.Cd "options GEOM_BDE"
|
2002-12-12 08:32:22 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Bf -symbolic
|
|
|
|
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:59:33 +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-12-12 08:32:22 +00:00
|
|
|
.Xr dump 8 Ns / Ns Xr restore 8
|
2002-11-04 09:27:01 +00:00
|
|
|
based migrations may be called for in the future.
|
2002-12-12 08:32:22 +00:00
|
|
|
.Ef
|
|
|
|
.Pp
|
2002-10-19 21:44:57 +00:00
|
|
|
The objective of this facility is to provide a high degree of
|
2002-10-20 19:38:28 +00:00
|
|
|
denial of access to the contents of a
|
|
|
|
.Dq cold
|
|
|
|
storage device.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Pp
|
|
|
|
Be aware that if the computer is compromised while up and running
|
2002-10-20 19:38:28 +00:00
|
|
|
.Em and
|
|
|
|
the storage device is actively attached and opened with a valid
|
2002-10-19 21:44:57 +00:00
|
|
|
pass-phrase, this facility offers no protection or denial of access
|
|
|
|
to the contents of the storage device.
|
|
|
|
.Pp
|
2002-12-10 14:21:55 +00:00
|
|
|
If, on the other hand, the device is
|
|
|
|
.Dq cold ,
|
2006-01-10 18:55:24 +00:00
|
|
|
it should present a formidable
|
2002-12-01 15:59:33 +00:00
|
|
|
challenge for an attacker to gain access to the contents in the absence of
|
2002-10-19 21:44:57 +00:00
|
|
|
a valid pass-phrase.
|
|
|
|
.Pp
|
|
|
|
Four cryptographic barriers must be passed to gain access to the data,
|
2002-12-01 15:59:33 +00:00
|
|
|
and only a valid pass-phrase will yield this access.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Pp
|
2002-11-04 09:27:01 +00:00
|
|
|
When the pass-phrase is entered, it is hashed with SHA2 into a 512 bit
|
2002-10-20 19:38:28 +00:00
|
|
|
.Dq key-material .
|
2002-12-01 15:59:33 +00:00
|
|
|
This is a way of producing cryptographic usable keys from a typically
|
2002-12-10 14:21:55 +00:00
|
|
|
.No all- Ns Tn ASCII
|
|
|
|
pass-phrase of an unpredictable user-selected length.
|
2002-11-04 09:27:01 +00:00
|
|
|
.Ss First barrier: the location of the \&"lock-sector".
|
2002-12-01 15:59:33 +00:00
|
|
|
During initialization, up to four independent but mutually aware
|
2002-12-10 14:21:55 +00:00
|
|
|
.Dq lock
|
2002-10-20 19:38:28 +00:00
|
|
|
sectors are written to the device in randomly chosen
|
2002-10-19 21:44:57 +00:00
|
|
|
locations.
|
2002-11-04 09:27:01 +00:00
|
|
|
These lock-sectors contain the 2048 random bit master-key and a number
|
|
|
|
of parameters of the layout geometry (more on this later).
|
|
|
|
Since the entire device will contain isotropic data, there is no
|
|
|
|
short-cut to rapidly determine which sequence of bytes contain a lock-sector.
|
|
|
|
.Pp
|
|
|
|
To locate a lock-sector, a small piece of data called the
|
|
|
|
.Dq metadata
|
2002-10-19 21:44:57 +00:00
|
|
|
and the key-material must be available.
|
2002-10-20 19:38:28 +00:00
|
|
|
The key-material decrypts the
|
2002-11-04 09:27:01 +00:00
|
|
|
metadata, which contains the byte offset on the device where the
|
|
|
|
corresponding lock-sector is located.
|
|
|
|
If the metadata is lost or unavailable but the key-material is at
|
2002-10-19 21:44:57 +00:00
|
|
|
hand, it would be feasible to do a brute force scan where each byte offset
|
2002-11-04 09:27:01 +00:00
|
|
|
of the device is checked to see if it contains the lock-sector data.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Ss Second barrier: decryption of the master-key using key-material.
|
2002-11-04 09:27:01 +00:00
|
|
|
The lock-sector contains an encrypted copy of an architecture neutral
|
|
|
|
byte-sequence which encodes the fields of the lock-structure.
|
|
|
|
The order in which these fields are encoded is determined from the key-material.
|
2006-01-10 18:55:24 +00:00
|
|
|
The encoded byte stream is encrypted with 256bit AES in CBC mode.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Ss Third barrier: decryption of the sector key.
|
2002-11-04 09:27:01 +00:00
|
|
|
For each sector, an MD5 hash over a
|
|
|
|
.Dq salt
|
2002-12-10 14:21:55 +00:00
|
|
|
from the lock-sector and the sector number is used to
|
2002-11-04 09:27:01 +00:00
|
|
|
.Dq cherry-pick
|
|
|
|
a subset of the master key,
|
|
|
|
which hashed together with the sector offset through MD5 produces the
|
|
|
|
.Dq kkey ,
|
2002-12-01 15:59:33 +00:00
|
|
|
the key which encrypts the sector key.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Ss Fourth barrier: decryption of the sector data.
|
2002-11-04 09:27:01 +00:00
|
|
|
The actual payload of the sector is encrypted with 128 bit AES in CBC mode
|
|
|
|
using a single-use random bits key.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Ss Examining the reverse path
|
2002-12-01 15:59:33 +00:00
|
|
|
Assuming an attacker knows an amount of plaintext and has managed to
|
2002-10-19 21:44:57 +00:00
|
|
|
locate the corresponding encrypted sectors on the device, gaining access
|
|
|
|
to the plaintext context of other sectors is a daunting task:
|
2002-11-04 09:27:01 +00:00
|
|
|
.Pp
|
2002-10-19 21:44:57 +00:00
|
|
|
First he will have to derive from the encrypted sector and the known plain
|
|
|
|
text the sector key(s) used.
|
2002-11-04 09:27:01 +00:00
|
|
|
At the time of writing, it has been speculated that it could maybe be
|
2002-12-01 15:59:33 +00:00
|
|
|
possible to break open AES in only 2^80 operations; even so, that is still
|
2002-11-04 09:27:01 +00:00
|
|
|
a very impossible task.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Pp
|
|
|
|
Armed with one or more sector keys, our patient attacker will then go
|
|
|
|
through essentially the same exercise, using the sector key and the
|
2010-08-16 15:18:30 +00:00
|
|
|
encrypted sector key to find the key used to encrypt the sector key.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Pp
|
2002-10-20 19:38:28 +00:00
|
|
|
Armed with one or more of these
|
2002-11-04 09:27:01 +00:00
|
|
|
.Dq kkeys ,
|
|
|
|
our attacker has to
|
|
|
|
run them backwards through MD5.
|
|
|
|
Even though he knows that the input to MD5 was 24 bytes and has the value
|
|
|
|
of 8 of these bytes from the sector number, he is still faced with 2^128
|
|
|
|
equally likely possibilities.
|
|
|
|
.Pp
|
2002-12-01 15:59:33 +00:00
|
|
|
Having successfully done that, our attacker has successfully discovered
|
2002-11-04 09:27:01 +00:00
|
|
|
up to 16 bytes of the master-key, but is still unaware which 16 bytes,
|
|
|
|
and in which other sectors any of these known bytes contribute to the kkey.
|
|
|
|
.Pp
|
|
|
|
To unravel the last bit, the attacker has to guess the 16 byte random-bits
|
|
|
|
salt stored in the lock-sector to recover the indexes into the masterkey.
|
|
|
|
.Pp
|
|
|
|
Any attacker with access to the necessary machine power to even attempt
|
|
|
|
this attack will be better off attempting to brute-force the pass-phrase.
|
2002-12-01 15:59:33 +00:00
|
|
|
.Ss Positive denial facilities
|
2002-10-19 21:44:57 +00:00
|
|
|
Considering the infeasibility of the above attack,
|
|
|
|
gaining access to the pass-phrase will be of paramount importance for an
|
|
|
|
attacker,
|
|
|
|
and a number of scenarios can be imagined where undue pressure will be
|
|
|
|
applied to an individual to divulge the pass-phrase.
|
|
|
|
.Pp
|
2002-12-10 14:21:55 +00:00
|
|
|
A
|
|
|
|
.Dq Blackening
|
|
|
|
feature provides a way for the user, given a moment of
|
2002-12-01 15:59:33 +00:00
|
|
|
opportunity, to destroy the master-key in such a way that the pass-phrase
|
|
|
|
will be acknowledged as good but access to the data will still be
|
2002-10-19 21:44:57 +00:00
|
|
|
denied.
|
|
|
|
.Ss A practical analogy
|
|
|
|
For persons who think cryptography is only slightly more interesting than
|
2002-10-20 15:27:32 +00:00
|
|
|
watching silicon sublimate the author humbly offers this analogy to the
|
|
|
|
keying scheme for a protected device:
|
2002-10-19 21:44:57 +00:00
|
|
|
.Pp
|
|
|
|
Imagine an installation with a vault with walls of several hundred meters
|
2002-12-10 14:21:55 +00:00
|
|
|
thick solid steel.
|
|
|
|
This vault can only be feasibly accessed using the
|
2002-10-19 21:44:57 +00:00
|
|
|
single key, which has a complexity comparable to a number with 600 digits.
|
|
|
|
.Pp
|
2002-12-10 14:21:55 +00:00
|
|
|
This key exists in four copies, each of which is stored in one of
|
2002-10-19 21:44:57 +00:00
|
|
|
four small safes, each of which can be opened
|
2002-12-10 14:21:55 +00:00
|
|
|
with unique key which has a complexity comparable to an 80 digit
|
2002-10-19 21:44:57 +00:00
|
|
|
number.
|
|
|
|
.Pp
|
2002-12-01 15:59:33 +00:00
|
|
|
In addition to the masterkey, each of the four safes also contains
|
2002-10-20 15:27:32 +00:00
|
|
|
the exact locations of all four key-safes which are located in
|
2002-11-04 09:27:01 +00:00
|
|
|
randomly chosen places on the outside surface of the vault where they
|
|
|
|
are practically impossible to detect when they are closed.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Pp
|
2002-10-20 15:27:32 +00:00
|
|
|
Finally, each safe contains four switches which are wired to a bar
|
2002-10-19 21:44:57 +00:00
|
|
|
of dynamite inside each of the four safes.
|
|
|
|
.Pp
|
2002-12-10 14:21:55 +00:00
|
|
|
In addition to this, a keyholder after opening his key-safe is
|
2002-10-19 21:44:57 +00:00
|
|
|
also able to install a copy of the master-key and re-key any of
|
|
|
|
key-safes (including his own).
|
|
|
|
.Pp
|
|
|
|
In normal use, the user will open the safe for which he has the key,
|
|
|
|
take out the master-key and access the vault.
|
|
|
|
When done, he will lock up the master-key in the safe again.
|
|
|
|
.Pp
|
|
|
|
If a keyholder-X for some reason distrusts keyholder-Y, she
|
|
|
|
has the option of opening her own safe, flipping one of the switches
|
2002-12-01 15:59:33 +00:00
|
|
|
and detonating the bar of dynamite in safe-Y.
|
2002-10-19 21:44:57 +00:00
|
|
|
This will obliterate the master-key in that safe and thereby deny
|
|
|
|
keyholder-Y access to the vault.
|
|
|
|
.Pp
|
|
|
|
Should the facility come under attack, any of the keyholders can detonate
|
|
|
|
all four bars of dynamite and thereby make sure that access to the
|
|
|
|
vault is denied to everybody, keyholders and attackers alike.
|
|
|
|
Should the facility fall to the enemy, and a keyholder be forced to apply
|
|
|
|
his personal key, he can do so in confidence that the contents of his safe
|
|
|
|
will not yield access to the vault, and the enemy will hopefully realize
|
2002-12-01 15:59:33 +00:00
|
|
|
that applying further pressure on the personnel will not give access to
|
2002-10-19 21:44:57 +00:00
|
|
|
the vault.
|
|
|
|
.Pp
|
|
|
|
The final point to make here is that it is perfectly possible to
|
2002-10-20 15:27:32 +00:00
|
|
|
make a detached copy of any one of these keys, including the master
|
2002-10-19 21:44:57 +00:00
|
|
|
key, and deposit or hide it as one sees fit.
|
2002-10-20 19:38:28 +00:00
|
|
|
.Ss Steganography support
|
2002-10-19 21:44:57 +00:00
|
|
|
When the device is initialized, it is possible to restrict the encrypted
|
|
|
|
data to a single contiguous area of the device.
|
|
|
|
If configured with care, this area could masquerade as some sort of
|
|
|
|
valid data or as random trash left behind by the systems operation.
|
|
|
|
.Pp
|
2002-12-01 15:59:33 +00:00
|
|
|
This can be used to offer a plausible deniability of existence, where
|
2002-10-19 21:44:57 +00:00
|
|
|
it will be impossible to prove that this specific area of the device
|
|
|
|
is in fact used to store encrypted data and not just random junk.
|
|
|
|
.Pp
|
|
|
|
The main obstacle in this is that the output from any encryption algorithm
|
|
|
|
worth its salt is so totally random looking that it stands out like a sore
|
|
|
|
thumb amongst practically any other sort of data which contains at least
|
|
|
|
some kind of structure or identifying byte sequences.
|
|
|
|
.Pp
|
|
|
|
Certain file formats like ELF contain multiple distinct sections, and it
|
|
|
|
would be possible to locate things just right in such a way that a device
|
2002-12-12 17:26:04 +00:00
|
|
|
contains a partition with a file system with a large executable,
|
2002-12-10 14:21:55 +00:00
|
|
|
.Pq Dq "a backup copy of my kernel"
|
2002-10-20 19:38:28 +00:00
|
|
|
where a non-loaded ELF section is laid out
|
2002-10-19 21:44:57 +00:00
|
|
|
consecutively on the device and thereby could be used to contain a
|
|
|
|
.Nm
|
|
|
|
encrypted device.
|
|
|
|
.Pp
|
|
|
|
Apart from the ability to instruct
|
|
|
|
.Nm
|
|
|
|
which those sectors are, no support is provided for creating such a setup.
|
|
|
|
.Ss Deployment suggestions
|
|
|
|
For personal use, it may be wise to make a backup copy of the masterkey
|
|
|
|
or use one of the four keys as a backup.
|
|
|
|
Fitting protection of this key is up to yourself, your local circumstances and
|
|
|
|
your imagination.
|
|
|
|
.Pp
|
|
|
|
For company or institutional use, it is strongly advised to make a copy
|
|
|
|
of the master-key and put it under whatever protection you have at your
|
|
|
|
means.
|
2002-10-20 20:59:10 +00:00
|
|
|
If you fail to do this, a disgruntled employee can deny you access to
|
2002-12-10 14:21:55 +00:00
|
|
|
the data
|
|
|
|
.Dq "by accident" .
|
2002-10-19 21:44:57 +00:00
|
|
|
(The employee can still intentionally deny access by applying another
|
2002-12-10 14:21:55 +00:00
|
|
|
encryption scheme to the data, but that problem has no technical solution.)
|
2002-10-19 21:44:57 +00:00
|
|
|
.Ss Cryptographic strength
|
2002-10-20 15:27:32 +00:00
|
|
|
This section lists the specific components which contribute to the cryptographic
|
2002-10-19 21:44:57 +00:00
|
|
|
strength of
|
|
|
|
.Nm .
|
|
|
|
.Pp
|
2002-12-10 14:21:55 +00:00
|
|
|
The payload is encrypted with AES in CBC mode using a 128 bit random
|
2002-10-20 19:38:28 +00:00
|
|
|
single-use key
|
2002-12-10 14:21:55 +00:00
|
|
|
.Pq Dq "the skey" .
|
2002-10-19 21:44:57 +00:00
|
|
|
AES is well documented.
|
|
|
|
.Pp
|
2002-11-04 09:27:01 +00:00
|
|
|
No IV is used in the encryption of the sectors, the assumption being
|
|
|
|
that since the key is random bits and single-use, an IV adds nothing to the
|
|
|
|
security of AES.
|
|
|
|
.Pp
|
2002-10-19 21:44:57 +00:00
|
|
|
The random key is produced with
|
|
|
|
.Xr arc4rand 9
|
2002-12-01 15:59:33 +00:00
|
|
|
which is believed to do a respectable job at producing unpredictable bytes.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Pp
|
|
|
|
The skey is stored on the device in a location which can be derived from
|
|
|
|
the location of the encrypted payload data.
|
|
|
|
The stored copy is encrypted with AES in CBC mode using a 128 bit key
|
2002-12-10 14:21:55 +00:00
|
|
|
.Pq Dq "the kkey"
|
2002-10-19 21:44:57 +00:00
|
|
|
derived
|
2002-11-04 09:27:01 +00:00
|
|
|
from a subset of the master key chosen by the output of an MD5 hash
|
|
|
|
over a 16 byte random bit static salt and the sector offset.
|
|
|
|
Up to 6.25% of the masterkey (16 bytes out of 2048 bits) will be selected
|
2002-12-10 14:21:55 +00:00
|
|
|
and hashed through MD5 with the sector offset to generate the kkey.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Pp
|
|
|
|
Up to four copies of the master-key and associated geometry information
|
2002-11-04 09:27:01 +00:00
|
|
|
is stored on the device in static randomly chosen sectors.
|
|
|
|
The exact location inside the sector is randomly chosen.
|
|
|
|
The order in which the fields are encoded depends on the key-material.
|
|
|
|
The encoded byte-stream is encrypted with AES in CBC mode using 256 bit
|
|
|
|
key-material.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Pp
|
|
|
|
The key-material is derived from the user-entered pass-phrase using
|
2002-11-04 09:27:01 +00:00
|
|
|
512 bit SHA2.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Pp
|
2002-10-20 19:38:28 +00:00
|
|
|
No chain is stronger than its weakest link, which usually is poor pass-phrases.
|
2002-10-19 21:44:57 +00:00
|
|
|
.Sh SEE ALSO
|
2002-12-10 14:21:55 +00:00
|
|
|
.Xr gbde 8
|
2002-10-19 21:44:57 +00:00
|
|
|
.Sh HISTORY
|
2002-12-10 14:21:55 +00:00
|
|
|
This software was developed for the
|
|
|
|
.Fx
|
|
|
|
Project by
|
|
|
|
.An Poul-Henning Kamp
|
|
|
|
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-19 21:44:57 +00:00
|
|
|
DARPA CHATS research program.
|
|
|
|
.Sh AUTHORS
|
2014-06-26 21:46:14 +00:00
|
|
|
.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org
|