/
tcplay.8
281 lines (281 loc) · 7.85 KB
/
tcplay.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
.\"
.\" Copyright (c) 2011
.\" The DragonFly Project. All rights reserved.
.\"
.\" 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.
.\" 3. Neither the name of The DragonFly Project nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific, prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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
.\" COPYRIGHT HOLDERS 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.
.\"
.Dd July 5, 2011
.Dt TCPLAY 8
.Os
.Sh NAME
.Nm tcplay
.Nd tool to manage TrueCrypt volumes
.Sh SYNOPSIS
.Nm
.Fl c
.Fl d Ar device
.Op Fl g
.Op Fl z
.Op Fl a Ar pbkdf_hash
.Op Fl b Ar cipher
.Op Fl f Ar keyfile_hidden
.Op Fl k Ar keyfile
.Op Fl x Ar pbkdf_hash
.Op Fl y Ar cipher
.Nm
.Fl i
.Fl d Ar device
.Op Fl e
.Op Fl f Ar keyfile_hidden
.Op Fl k Ar keyfile
.Op Fl s Ar system_device
.Nm
.Fl m Ar mapping
.Fl d Ar device
.Op Fl e
.Op Fl f Ar keyfile_hidden
.Op Fl k Ar keyfile
.Op Fl s Ar system_device
.Nm
.Fl h | v
.Sh DESCRIPTION
The
.Nm
utility provides full support for creating and opening/mapping
TrueCrypt-compatible volumes.
It supports the following commands, each with a set of options
detailed further below:
.Bl -tag -width indent
.It Fl c , Fl -create
Create a new encrypted TrueCrypt volume on the device
specified by
.Fl -device .
.It Fl h, Fl -help
Print help message and exit.
.It Fl i , Fl -info
Print out information about the encrypted device specified by
.Fl -device .
.It Fl m Ar mapping , Fl -map Ns = Ns Ar mapping
Map the encrypted TrueCrypt volume on the device specified by
.Fl -device
as a
.Xr dm 4
mapping called
.Ar mapping .
.It Fl v, Fl -version
Print version message and exit.
.El
.Pp
Options common to all commands are:
.Bl -tag -width indent
.It Fl d Ar device , Fl -device Ns = Ns Ar device
Specifies the disk
.Ar device
on which the TrueCrypt volume resides/will reside.
This option is mandatory for all commands.
.It Fl f Ar keyfile_hidden , Fl -keyfile-hidden Ns = Ns Ar keyfile_hidden
Specifies a keyfile
to use in addition to the passphrase when either creating a
hidden volume or when protecting a hidden volume while mapping
or querying the outer volume.
If you only intend to map a hidden volume, the
.Fl -keyfile
option has to be used.
This option can appear multiple times; if so, multiple
keyfiles will be used.
.It Fl k Ar keyfile , Fl -keyfile Ns = Ns Ar keyfile
Specifies a
.Ar keyfile
to use in addition to the passphrase.
This option can appear multiple times; if so, multiple
keyfiles will be used.
.El
.Pp
Additional options for the
.Fl -create
command are:
.Bl -tag -width indent
.It Fl a Ar pbkdf_hash , Fl -pbkdf-prf Ns = Ns Ar pbkdf_hash
Specifies which hash algorithm to use for the PBKDF2 password
derivation.
To see which algorithms are supported, specify
.Fl -pbkdf-prf Ns = Ns Cm help .
.It Fl b Ar cipher , Fl -cipher Ns = Ns Ar cipher
Specifies which cipher algorithm or cascade of ciphers to use
to encrypt the new volume.
To see which algorithms are supported, specify
.Fl -cipher Ns = Ns Cm help .
.It Fl g, Fl -hidden
Specifies that the newly created volume will contain a hidden
volume.
The keyfiles applied to the passphrase for the hidden
volume are those specified by
.Fl -keyfile-hidden .
The user will be prompted for the size of the hidden volume
interactively.
.It Fl x Ar pbkdf_hash , Fl -pbkdf-prf-hidden Ns = Ns Ar pbkdf_hash
Specifies which hash algorithm to use for the PBKDF2 password
derivation for the hidden volume.
Only valid in conjunction with
.Fl -hidden .
If no algorithm is specified, the same as for the outer volume
will be used.
To see which algorithms are supported, specify
.Fl -pbkdf-prf-hidden Ns = Ns Cm help .
.It Fl y Ar cipher , Fl -cipher-hidden Ns = Ns Ar cipher
Specifies which cipher algorithm or cascade of ciphers to use
to encrypt the hidden volume on the new TrueCrypt volume.
Only valid in conjunction with
.Fl -hidden .
If no cipher is specified, the same as for the outer volume
will be used.
To see which algorithms are supported, specify
.Fl -cipher-hidden Ns = Ns Cm help .
.It Fl z, Fl -insecure-erase
Skips the secure erase of the disk.
Use this option carefully as it is a security risk!
.El
.Pp
Additional options for the
.Fl -info
and
.Fl -map
commands are:
.Bl -tag -width indent
.It Fl e, Fl -protect-hidden
Specifies that an outer volume will be queried or mapped, but
its reported size will be adjusted accordingly to the size of
the hidden volume contained in it.
Both the hidden volume and outer volume passphrase and keyfiles
will be required.
.It Fl s Ar system_device , Fl -system-encryption Ns = Ns Ar system_device
This option is required if you are attempting to access a device
that uses system encryption, for example an encrypted
.Tn Windows
system partition.
The
.Fl -device
option will point at the actual encrypted partition, while the
.Ar system_device
argument will point to the parent device (i.e.\& underlying physical disk)
of the encrypted partition.
.El
.Pp
To unmap volumes,
the
.Xr dmsetup 8
utility is used.
.Sh EXAMPLES
Create a new TrueCrypt volume on
.Pa /dev/vn0
using the cipher cascade
of AES and Twofish and the Whirlpool hash algorithm for
PBKDF2 password derivation and two keyfiles,
.Pa one.key
and
.Pa two.key :
.Bd -ragged -offset indent
.Nm Fl -create
.Fl -device Ns = Ns Cm /dev/vn0
.Fl -cipher Ns = Ns Cm AES-256-XTS,TWOFISH-256-XTS
.Fl -pbkdf-prf Ns = Ns Cm whirlpool
.Fl -keyfile Ns = Ns Cm one.key
.Fl -keyfile Ns = Ns Cm two.key
.Ed
.Pp
Map the outer volume on the TrueCrypt volume on
.Pa /dev/vn0
as
.Sy truecrypt1 ,
but protect the hidden volume, using the keyfile
.Pa hidden.key ,
from being overwritten:
.Bd -ragged -offset indent
.Nm Fl -map Ns = Ns Cm truecrypt1
.Fl -device Ns = Ns Cm /dev/vn0
.Fl -protect-hidden
.Fl -keyfile-hidden Ns = Ns Cm hidden.key
.Ed
.Pp
Map the hidden volume on the TrueCrypt volume on
.Pa /dev/vn0
as
.Sy truecrypt2 ,
using the keyfile
.Pa hidden.key :
.Bd -ragged -offset indent
.Nm Fl -map Ns = Ns Cm truecrypt2
.Fl -device Ns = Ns Cm /dev/vn0
.Fl -keyfile Ns = Ns Cm hidden.key
.Ed
.Pp
Map and mount the volume in the file
.Pa secvol
on Linux:
.Bd -ragged -offset indent
.Sy losetup Cm /dev/loop1 Cm secvol
.Ed
.Bd -ragged -offset indent
.Nm Fl -map Ns = Ns Cm secv
.Fl -device Ns = Ns Cm /dev/loop1
.Ed
.Bd -ragged -offset indent
.Sy mount Cm /dev/mapper/secv Cm /mnt
.Ed
.Pp
Similarly on
.Dx :
.Bd -ragged -offset indent
.Sy vnconfig Cm vn1 Cm secvol
.Ed
.Bd -ragged -offset indent
.Nm Fl -map Ns = Ns Cm secv
.Fl -device Ns = Ns Cm /dev/vn1
.Ed
.Bd -ragged -offset indent
.Sy mount Cm /dev/mapper/secv Cm /mnt
.Ed
.Pp
Unmapping the volume
.Sy truecrypt2
on both Linux and
.Dx
after unmounting:
.Bd -ragged -offset indent
.Sy dmsetup Cm remove Cm truecrypt2
.Ed
.Sh SEE ALSO
.Xr crypttab 5 ,
.Xr cryptsetup 8
.Sh HISTORY
The
.Nm
utility appeared in
.Dx 2.11 .
.Sh AUTHORS
.An Alex Hornung