<s>
Disk	O
encryption	O
is	O
a	O
special	O
case	O
of	O
data	B-General_Concept
at	I-General_Concept
rest	I-General_Concept
protection	O
when	O
the	O
storage	O
medium	O
is	O
a	O
sector-addressable	O
device	O
(	O
e.g.	O
,	O
a	O
hard	O
disk	O
)	O
.	O
</s>
<s>
Data	B-Application
retrieval	I-Application
and	O
storage	O
should	O
both	O
be	O
fast	O
operations	O
,	O
no	O
matter	O
where	O
on	O
the	O
disk	O
the	O
data	O
is	O
stored	O
.	O
</s>
<s>
The	O
first	O
property	O
requires	O
defining	O
an	O
adversary	B-General_Concept
from	O
whom	O
the	O
data	O
is	O
being	O
kept	O
confidential	O
.	O
</s>
<s>
The	O
strongest	O
adversaries	B-General_Concept
studied	O
in	O
the	O
field	O
of	O
disk	O
encryption	O
have	O
these	O
abilities	O
:	O
</s>
<s>
A	O
method	O
provides	O
good	O
confidentiality	O
if	O
the	O
only	O
information	O
such	O
an	O
adversary	B-General_Concept
can	O
determine	O
over	O
time	O
is	O
whether	O
the	O
data	O
in	O
a	O
sector	B-Application
has	O
or	O
has	O
not	O
changed	O
since	O
the	O
last	O
time	O
they	O
looked	O
.	O
</s>
<s>
The	O
second	O
property	O
requires	O
dividing	O
the	O
disk	O
into	O
several	O
sectors	O
,	O
usually	O
512	B-Application
bytes	I-Application
(	O
bits	O
)	O
long	O
,	O
which	O
are	O
encrypted	O
and	O
decrypted	O
independently	O
of	O
each	O
other	O
.	O
</s>
<s>
Otherwise	O
,	O
the	O
adversary	B-General_Concept
could	O
decrypt	O
any	O
sector	B-Application
of	O
the	O
disk	O
by	O
copying	O
it	O
to	O
an	O
unused	O
sector	B-Application
of	O
the	O
disk	O
and	O
requesting	O
its	O
decryption	O
.	O
</s>
<s>
However	O
,	O
it	O
indirectly	O
prohibits	O
the	O
use	O
of	O
stream	B-Algorithm
ciphers	I-Algorithm
,	O
since	O
stream	B-Algorithm
ciphers	I-Algorithm
require	O
,	O
for	O
their	O
security	O
,	O
that	O
the	O
same	O
initial	O
state	O
not	O
be	O
used	O
twice	O
(	O
which	O
would	O
be	O
the	O
case	O
if	O
a	O
sector	B-Application
is	O
updated	O
with	O
different	O
data	O
)	O
;	O
thus	O
this	O
would	O
require	O
an	O
encryption	O
method	O
to	O
store	O
separate	O
initial	O
states	O
for	O
every	O
sector	B-Application
on	O
disk	O
—	O
seemingly	O
a	O
waste	O
of	O
space	O
.	O
</s>
<s>
The	O
alternative	O
,	O
a	O
block	O
cipher	O
,	O
is	O
limited	O
to	O
a	O
certain	O
block	B-General_Concept
size	I-General_Concept
(	O
usually	O
128	O
or	O
256	O
bits	O
)	O
.	O
</s>
<s>
Because	O
of	O
this	O
,	O
disk	O
encryption	O
chiefly	O
studies	O
chaining	B-Algorithm
modes	I-Algorithm
,	O
which	O
expand	O
the	O
encryption	O
block	O
length	O
to	O
cover	O
a	O
whole	O
disk	B-Application
sector	I-Application
.	O
</s>
<s>
The	O
considerations	O
already	O
listed	O
make	O
several	O
well-known	O
chaining	B-Algorithm
modes	I-Algorithm
unsuitable	O
:	O
ECB	O
mode	O
,	O
which	O
cannot	O
be	O
tweaked	O
,	O
and	O
modes	O
that	O
turn	O
block	O
ciphers	O
into	O
stream	B-Algorithm
ciphers	I-Algorithm
,	O
such	O
as	O
the	O
CTR	O
mode	O
.	O
</s>
<s>
These	O
three	O
properties	O
do	O
not	O
provide	O
any	O
assurance	O
of	O
disk	O
integrity	O
;	O
that	O
is	O
,	O
they	O
do	O
n't	O
tell	O
you	O
whether	O
an	O
adversary	B-General_Concept
has	O
been	O
modifying	O
your	O
ciphertext	O
.	O
</s>
<s>
In	O
part	O
,	O
this	O
is	O
because	O
an	O
absolute	O
assurance	O
of	O
disk	O
integrity	O
is	O
impossible	O
:	O
no	O
matter	O
what	O
,	O
an	O
adversary	B-General_Concept
could	O
always	O
revert	O
the	O
entire	O
disk	O
to	O
a	O
prior	O
state	O
,	O
circumventing	O
any	O
such	O
checks	O
.	O
</s>
<s>
If	O
some	O
non-absolute	O
level	O
of	O
disk	O
integrity	O
is	O
desired	O
,	O
it	O
can	O
be	O
achieved	O
within	O
the	O
encrypted	O
disk	O
on	O
a	O
file-by-file	O
basis	O
using	O
message	B-Algorithm
authentication	I-Algorithm
codes	I-Algorithm
.	O
</s>
<s>
Like	O
most	O
encryption	O
schemes	O
,	O
block	O
cipher-based	O
disk	O
encryption	O
makes	O
use	O
of	O
modes	B-Algorithm
of	I-Algorithm
operation	I-Algorithm
,	O
which	O
allow	O
encrypting	O
larger	O
amounts	O
of	O
data	O
than	O
the	O
ciphers	O
 '	O
block-size	O
(	O
typically	O
128	O
bits	O
)	O
.	O
</s>
<s>
Since	O
there	O
is	O
n't	O
a	O
"	O
previous	O
block	O
's	O
ciphertext	O
"	O
for	O
the	O
first	O
block	O
,	O
an	O
initialization	B-Algorithm
vector	I-Algorithm
(	O
IV	O
)	O
must	O
be	O
used	O
as	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
the	O
IVs	O
are	O
predictable	O
,	O
then	O
an	O
adversary	B-General_Concept
may	O
leave	O
a	O
"	O
watermark	O
"	O
on	O
the	O
disk	O
,	O
i.e.	O
,	O
store	O
a	O
specially	O
created	O
file	O
or	O
combination	O
of	O
files	O
identifiable	O
even	O
after	O
encryption	O
.	O
</s>
<s>
To	O
protect	O
against	O
the	O
watermarking	O
attack	O
,	O
a	O
cipher	O
or	O
a	O
hash	B-Algorithm
function	I-Algorithm
is	O
used	O
to	O
generate	O
the	O
IVs	O
from	O
the	O
key	O
and	O
the	O
current	O
sector	B-Application
number	O
,	O
so	O
that	O
an	O
adversary	B-General_Concept
cannot	O
predict	O
the	O
IVs	O
.	O
</s>
<s>
ESSIV	O
is	O
a	O
method	O
for	O
generating	O
initialization	B-Algorithm
vectors	I-Algorithm
for	O
block	O
encryption	O
to	O
use	O
in	O
disk	O
encryption	O
.	O
</s>
<s>
The	O
usual	O
methods	O
for	O
generating	O
IVs	O
are	O
predictable	O
sequences	O
of	O
numbers	O
based	O
on	O
,	O
for	O
example	O
,	O
time	O
stamp	O
or	O
sector	B-Application
number	O
,	O
and	O
permit	O
certain	O
attacks	O
such	O
as	O
a	O
watermarking	O
attack	O
.	O
</s>
<s>
ESSIV	O
prevents	O
such	O
attacks	O
by	O
generating	O
IVs	O
from	O
a	O
combination	O
of	O
the	O
sector	B-Application
number	O
SN	O
with	O
the	O
hash	B-Algorithm
of	O
the	O
key	O
.	O
</s>
<s>
It	O
is	O
the	O
combination	O
with	O
the	O
key	O
in	O
form	O
of	O
a	O
hash	B-Algorithm
that	O
makes	O
the	O
IV	O
unpredictable	O
.	O
</s>
<s>
ESSIV	O
was	O
designed	O
by	O
Clemens	O
Fruhwirth	O
and	O
has	O
been	O
integrated	O
into	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
since	O
version	O
2.6.10	O
,	O
though	O
a	O
similar	O
scheme	O
has	O
been	O
used	O
to	O
generate	O
IVs	O
for	O
OpenBSD	B-Operating_System
's	O
swap	O
encryption	O
since	O
2000	O
.	O
</s>
<s>
ESSIV	O
is	O
supported	O
as	O
an	O
option	O
by	O
the	O
dm-crypt	O
and	O
FreeOTFE	B-Application
disk	O
encryption	O
systems	O
.	O
</s>
<s>
If	O
the	O
plaintext	O
is	O
known	O
to	O
the	O
adversary	B-General_Concept
,	O
it	O
is	O
possible	O
to	O
change	O
every	O
second	O
plaintext	O
block	O
to	O
a	O
value	O
chosen	O
by	O
the	O
attacker	O
,	O
while	O
the	O
blocks	O
in	O
between	O
are	O
changed	O
to	O
random	O
values	O
.	O
</s>
<s>
In	O
order	O
to	O
prevent	O
such	O
elaborate	O
attacks	O
,	O
different	O
modes	B-Algorithm
of	I-Algorithm
operation	I-Algorithm
were	O
introduced	O
:	O
tweakable	O
narrow-block	O
encryption	O
(	O
LRW	O
and	O
XEX	O
)	O
and	O
wide-block	O
encryption	O
(	O
CMC	O
and	O
EME	O
)	O
.	O
</s>
<s>
For	O
example	O
,	O
for	O
AES	B-Algorithm
with	O
a	O
256-bit	O
key	O
,	O
is	O
a	O
256-bit	O
number	O
and	O
is	O
a	O
128-bit	O
number	O
.	O
</s>
<s>
Here	O
multiplication	O
and	O
addition	O
are	O
performed	O
in	O
the	O
finite	O
field	O
(	O
for	O
AES	B-Algorithm
)	O
.	O
</s>
<s>
With	O
some	O
precomputation	O
,	O
only	O
a	O
single	O
multiplication	O
per	O
sector	B-Application
is	O
required	O
(	O
note	O
that	O
addition	O
in	O
a	O
binary	O
finite	O
field	O
is	O
a	O
simple	O
bitwise	O
addition	O
,	O
also	O
known	O
as	O
xor	O
)	O
:	O
,	O
where	O
are	O
precomputed	O
for	O
all	O
possible	O
values	O
of	O
.	O
</s>
<s>
This	O
mode	B-Algorithm
of	I-Algorithm
operation	I-Algorithm
needs	O
only	O
a	O
single	O
encryption	O
per	O
block	O
and	O
protects	O
against	O
all	O
the	O
above	O
attacks	O
except	O
a	O
minor	O
leak	O
:	O
if	O
the	O
user	O
changes	O
a	O
single	O
plaintext	O
block	O
in	O
a	O
sector	B-Application
then	O
only	O
a	O
single	O
ciphertext	O
block	O
changes	O
.	O
</s>
<s>
Some	O
security	O
concerns	O
exist	O
with	O
LRW	O
,	O
and	O
this	O
mode	B-Algorithm
of	I-Algorithm
operation	I-Algorithm
has	O
now	O
been	O
replaced	O
by	O
XTS	O
.	O
</s>
<s>
LRW	O
is	O
employed	O
by	O
BestCrypt	O
and	O
supported	O
as	O
an	O
option	O
for	O
dm-crypt	O
and	O
FreeOTFE	B-Application
disk	O
encryption	O
systems	O
.	O
</s>
<s>
Another	O
tweakable	O
encryption	B-Algorithm
mode	I-Algorithm
,	O
XEX	O
(	O
xor	B-Algorithm
–	I-Algorithm
encrypt	I-Algorithm
–	I-Algorithm
xor	I-Algorithm
)	O
,	O
was	O
designed	O
by	O
Rogaway	O
to	O
allow	O
efficient	O
processing	O
of	O
consecutive	O
blocks	O
(	O
with	O
respect	O
to	O
the	O
cipher	O
used	O
)	O
within	O
one	O
data	O
unit	O
(	O
e.g.	O
,	O
a	O
disk	B-Application
sector	I-Application
)	O
.	O
</s>
<s>
The	O
tweak	O
is	O
represented	O
as	O
a	O
combination	O
of	O
the	O
sector	B-Application
address	O
and	O
index	O
of	O
the	O
block	O
within	O
the	O
sector	B-Application
(	O
the	O
original	O
XEX	O
mode	O
proposed	O
by	O
Rogaway	O
allows	O
several	O
indices	O
)	O
.	O
</s>
<s>
is	O
the	O
number	O
of	O
the	O
sector	B-Application
,	O
</s>
<s>
is	O
the	O
number	O
of	O
the	O
block	O
within	O
the	O
sector	B-Application
.	O
</s>
<s>
The	O
basic	O
operations	O
of	O
the	O
LRW	O
mode	O
(	O
AES	B-Algorithm
cipher	I-Algorithm
and	O
Galois	O
field	O
multiplication	O
)	O
are	O
the	O
same	O
as	O
the	O
ones	O
used	O
in	O
the	O
Galois/Counter	B-Algorithm
Mode	I-Algorithm
(	O
GCM	O
)	O
,	O
thus	O
permitting	O
a	O
compact	O
implementation	O
of	O
the	O
universal	O
LRW/XEX/GCM	O
hardware	O
.	O
</s>
<s>
Ciphertext	B-Algorithm
stealing	I-Algorithm
provides	O
support	O
for	O
sectors	O
with	O
size	O
not	O
divisible	O
by	O
block	B-General_Concept
size	I-General_Concept
,	O
for	O
example	O
,	O
520-byte	O
sectors	O
and	O
16-byte	O
blocks	O
.	O
</s>
<s>
XTS-AES	O
was	O
standardized	O
on	O
2007-12-19	O
as	O
IEEE	O
P1619	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
users	O
wanting	O
AES-256	B-Algorithm
and	O
AES-128	B-Algorithm
encryption	O
must	O
supply	O
512	O
bits	O
and	O
256	O
bits	O
of	O
key	O
respectively	O
.	O
</s>
<s>
SP	O
800-38E	O
is	O
a	O
recommendation	O
for	O
the	O
XTS-AES	O
mode	B-Algorithm
of	I-Algorithm
operation	I-Algorithm
,	O
as	O
standardized	O
by	O
IEEE	O
Std	O
1619-2007	O
,	O
for	O
cryptographic	O
modules	O
.	O
</s>
<s>
The	O
publication	O
approves	O
the	O
XTS-AES	O
mode	O
of	O
the	O
AES	B-Algorithm
algorithm	O
by	O
reference	O
to	O
the	O
IEEE	O
Std	O
1619-2007	O
,	O
subject	O
to	O
one	O
additional	O
requirement	O
,	O
which	O
limits	O
the	O
maximum	O
size	O
of	O
each	O
encrypted	O
data	O
unit	O
(	O
typically	O
a	O
sector	B-Application
or	O
disk	B-General_Concept
block	I-General_Concept
)	O
to	O
220	O
AES	B-Algorithm
blocks	O
.	O
</s>
<s>
According	O
to	O
SP	O
800-38E	O
,	O
"	O
In	O
the	O
absence	O
of	O
authentication	O
or	O
access	O
control	O
,	O
XTS-AES	O
provides	O
more	O
protection	O
than	O
the	O
other	O
approved	O
confidentiality-only	O
modes	O
against	O
unauthorized	O
manipulation	O
of	O
the	O
encrypted	O
data.	O
"	O
</s>
<s>
XTS	O
is	O
supported	O
by	O
BestCrypt	O
,	O
Botan	B-Protocol
,	O
NetBSD	B-Device
's	O
cgd	O
,	O
dm-crypt	O
,	O
FreeOTFE	B-Application
,	O
TrueCrypt	B-Application
,	O
VeraCrypt	B-Operating_System
,	O
DiskCryptor	O
,	O
FreeBSD	B-Operating_System
's	O
geli	B-Application
,	O
OpenBSD	B-Operating_System
softraid	O
disk	O
encryption	O
software	O
,	O
OpenSSL	B-Language
,	O
Mac	B-Application
OS	I-Application
X	I-Application
Lion	I-Application
's	O
FileVault	O
2	O
,	O
Windows	B-Operating_System
10	I-Operating_System
's	O
BitLocker	O
and	O
wolfCrypt	O
.	O
</s>
<s>
This	O
would	O
require	O
maintaining	O
checksums	O
for	O
all	O
data	O
and	O
metadata	O
on	O
disk	O
,	O
as	O
done	O
in	O
ZFS	B-Application
or	O
Btrfs	B-Operating_System
.	O
</s>
<s>
However	O
,	O
in	O
commonly	O
used	O
file	O
systems	O
such	O
as	O
ext4	B-Application
and	O
NTFS	B-Application
only	O
metadata	O
is	O
protected	O
against	O
tampering	O
,	O
while	O
the	O
detection	O
of	O
data	O
tampering	O
is	O
non-existent	O
.	O
</s>
<s>
As	O
a	O
given	O
sector	B-Application
is	O
rewritten	O
,	O
attackers	O
can	O
collect	O
fine-grained	O
(	O
16	O
byte	O
)	O
ciphertexts	O
,	O
which	O
can	O
be	O
used	O
for	O
analysis	O
or	O
replay	O
attacks	O
(	O
at	O
a	O
16-byte	O
granularity	O
)	O
.	O
</s>
<s>
It	O
would	O
be	O
possible	O
to	O
define	O
sector-wide	O
block	O
ciphers	O
,	O
unfortunately	O
with	O
degraded	O
performance	O
(	O
see	O
below	O
)	O
.	O
</s>
<s>
Unfortunately	O
,	O
the	O
price	O
is	O
a	O
twofold	O
degradation	O
of	O
performance	O
:	O
each	O
block	O
must	O
be	O
encrypted	O
twice	O
;	O
many	O
consider	O
this	O
to	O
be	O
too	O
high	O
a	O
cost	O
,	O
since	O
the	O
same	O
leak	O
on	O
a	O
sector	B-Application
level	O
is	O
unavoidable	O
anyway	O
.	O
</s>
<s>
CMC	O
,	O
introduced	O
by	O
Halevi	O
and	O
Rogaway	O
,	O
stands	O
for	O
CBC	O
–	O
mask	O
–	O
CBC	O
:	O
the	O
whole	O
sector	B-Application
encrypted	O
in	O
CBC	O
mode	O
(	O
with	O
)	O
,	O
the	O
ciphertext	O
is	O
masked	O
by	O
xoring	O
with	O
,	O
and	O
re-encrypted	O
in	O
CBC	O
mode	O
starting	O
from	O
the	O
last	O
block	O
.	O
</s>
<s>
When	O
the	O
underlying	O
block	O
cipher	O
is	O
a	O
strong	O
pseudorandom	O
permutation	O
(	O
PRP	O
)	O
then	O
on	O
the	O
sector	B-Application
level	O
the	O
scheme	O
is	O
a	O
tweakable	O
PRP	O
.	O
</s>
<s>
While	O
the	O
authenticated	B-Algorithm
encryption	I-Algorithm
scheme	O
IAPM	B-Algorithm
provides	O
encryption	O
as	O
well	O
as	O
an	O
authentication	O
tag	O
,	O
the	O
encryption	O
component	O
of	O
the	O
IAPM	B-Algorithm
mode	I-Algorithm
completely	O
describes	O
the	O
LRW	O
and	O
XEX	O
schemes	O
above	O
,	O
and	O
hence	O
XTS	O
without	O
the	O
ciphertext	B-Algorithm
stealing	I-Algorithm
aspect	O
.	O
</s>
