Remove duplicate sentence in man page (patch by Till Maas).
[platform/upstream/cryptsetup.git] / man / cryptsetup.8
1 .TH CRYPTSETUP "8" "March 2005" "cryptsetup 1.0.3" "Maintainance Commands"
2 .SH NAME
3 cryptsetup - setup cryptographic volumes for dm-crypt (including LUKS extension)
4 .SH SYNOPSIS
5
6 .B cryptsetup <options> <action> <action args>
7
8 .SH DESCRIPTION
9 .\" Add any additional description here
10 .PP
11 cryptsetup is used to conveniently setup dm-crypt managed device-mapper mappings. For basic dm-crypt mappings, there are five operations.
12 .SH ACTIONS
13 These strings are valid for \fB<action>\fR, followed by their \fB<action args>\fR:
14
15 \fIcreate\fR <name> <device>
16 .IP
17 creates a mapping with <name> backed by device <device>.
18 <options> can be [\-\-hash, \-\-cipher, \-\-verify-passphrase, \-\-key-file, \-\-key-size, \-\-offset, \-\-skip, \-\-readonly]
19 .PP
20 \fIremove\fR <name>
21 .IP
22 removes an existing mapping <name>. No options.
23 .PP
24 \fIstatus\fR <name>
25 .IP
26 reports the status for the mapping <name>. No options.
27 .PP
28 \fIresize\fR <name>
29 .IP
30 resizes an active mapping <name>. <options> must include \-\-size 
31 .PP
32 .br
33 .SH LUKS EXTENSION
34
35 LUKS, Linux Unified Key Setup, is a standard for hard disk encryption. It standardizes a partition header, as well as the format of the bulk data. LUKS can manage multiple passwords, that can be revoked effectively and that are protected against dictionary attacks with PBKDF2. 
36
37 These are valid LUKS actions:
38
39 \fIluksFormat\fR <device> [<key file>]
40 .IP
41 initializes a LUKS partition and sets the initial key, either via prompting or via <key file>.
42 <options> can be [\-\-cipher, \-\-verify-passphrase, \-\-key-size, \-\-key-slot].
43 .PP
44 \fIluksOpen\fR <device> <name>
45 .IP
46 opens the LUKS partition <device> and sets up a mapping <name> after successful verification of the supplied key material (either via key file by \-\-key-file, or via prompting).
47 <options> can be [\-\-key-file, \-\-readonly].
48 .PP
49 \fIluksClose\fR <name>
50 .IP
51 identical to \fIremove\fR.
52 .PP
53 \fIluksAddKey\fR <device> [<new key file>]
54 .IP
55 add a new key file/passphrase. An existing passphrase or key file (via \-\-key-file) must be supplied. The key file with the new material is supplied as a positional argument. <options> can be [\-\-key-file, \-\-key-slot].
56 .PP
57 \fIluksRemoveKey\fR <device> [<key file>] 
58 .IP
59 remove supplied key or key file from LUKS device
60 .PP
61 \fIluksKillSlot\fR <device> <key slot number>
62 .IP
63 wipe key with number <key slot> from LUKS device. A remaining passphrase or key file (via \-\-key-file) must be supplied. <options> can be [\-\-key-file].
64 .PP
65 \fIluksDelKey\fR <device> <key slot number>
66 .IP
67 identical to luksKillSlot, but deprecated action name.
68 .PP
69 \fIluksUUID\fR <device>
70 .IP
71 print UUID, if <device> has a LUKS header. No options.
72 .PP
73 \fIisLuks\fR <device>
74 .IP
75 returns true, if <device> is a LUKS partition. Otherwise, false. No options.
76 .PP
77 \fIluksDump\fR <device>
78 .IP
79 dumps the header information of a LUKS partition. No options.
80 .PP
81
82 For more information about LUKS, see \fBhttp://luks.endorphin.org\fR
83
84 .SH OPTIONS
85 .TP
86 .B "\-\-hash, \-h"
87 specifies hash to use for password hashing. This option is only relevant for the "create" action. The hash string is passed to libgcrypt, so all hashes accepted by gcrypt are supported. Default is "ripemd160".
88 .TP
89 .B "\-\-cipher, \-c"
90 set cipher specification string. Usually, this is "aes-cbc-plain". For pre-2.6.10 kernels, use "aes-plain" as they don't understand the new cipher spec strings. To use ESSIV, use "aes-cbc-essiv:sha256".
91 .TP
92 .B "\-\-verify-passphrase, \-y"
93 query for passwords twice. Useful when creating a (regular) mapping for the first time, or when running \fIluksFormat\fR.
94 .TP
95 .B "\-\-key-file, \-d"
96 use file as key material. With LUKS, key material supplied in key files via \-d are always used for existing passphrases. If you want to set a new key via a key file, you have to use a positional arg to \fIluksFormat\fR or \fIluksAddKey\fR.
97
98 If the key file is "-", stdin will be used. This is different from how cryptsetup usually reads from stdin. See section \fBNOTES ON PASSWORD PROCESSING\fR for more information.
99 .TP
100 .B "\-\-key-slot, \-S"
101 For LUKS operations that add key material, this options allows to you specify which key slot is selected for the new key. This option can be used for luksFormat and luksAddKey.
102 .TP
103 .B "\-\-key-size, \-s"
104 set key size in bits. Has to be a multiple of 8 bits. The key size is limited by the used cipher. See output of /proc/crypto for more information. Can be used for \fIcreate\fR or \fIluksFormat\fR, all other LUKS actions will ignore this flag, as the key-size is specified by the partition header. Default is 128.
105 .TP
106 .B "\-\-size, \-b"
107 force the size of the underlying device in sectors.
108 .TP
109 .B "\-\-offset, \-o"
110 start offset in the backend device.
111 .TP
112 .B "\-\-skip, \-p"
113 how many sectors of the encrypted data to skip at the beginning. This is different from the \-\-offset options with respect to IV calculations. Using \-\-offset will shift the IV calculation by the same negative amount. Hence, if \-\-offset \fIn\fR, sector \fIn\fR will be the first sector on the mapping with IV \fI0\fR. Using \-\-skip would have resulted in sector \fIn\fR being the first sector also, but with IV \fIn\fR.
114 .TP
115 .B "\-\-readonly"
116 set up a read-only mapping.
117 .TP
118 .B "\-\-iter-time, \-i"
119 The number of milliseconds to spend with PBKDF2 password processing. This option is only relevant to the LUKS operations as \fIluksFormat\fR or \fIluksAddKey\fR.
120 .TP
121 .B "\-\-batch-mode, \-q"
122 Do not ask for confirmation. This option is only relevant for \fIluksFormat\fR.
123 .TP
124 .B "\-\-timeout, \-t"
125 The number of seconds to wait before timeout. This option is relevant every time a password is asked, like \fIcreate\fR, \fIluksOpen\fR, \fIluksFormat\fR or \fIluksAddKey\fR. It has no effect if used in conjunction with \-\-key-file.
126 .TP
127 .B "\-\-tries, \-T"
128 How often the input of the passphrase shall be retried. This option is relevant every time a password is asked, like \fIcreate\fR, \fIluksOpen\fR, \fIluksFormat\fR or \fIluksAddKey\fR. The default is 3 tries.
129 .TP
130 .B "\-\-align-payload=\fIvalue\fR"
131 Align payload at a boundary of \fIvalue\fR 512-byte sectors. This option is relevant for \fIluksFormat\fR.  If your block device lives on a RAID, it is
132 useful to align the filesystem at full stripe boundaries so it can take advantage of the RAID's geometry.  See for instance the sunit and swidth options
133 in the mkfs.xfs manual page. By default, the payload is aligned at an 8 sector (4096 byte) boundary.
134 .TP
135 .B "\-\-version"
136 Show the version.
137
138 .SH NOTES ON PASSWORD PROCESSING
139 \fIFrom a file descriptor or a terminal\fR: Password processing is new-line sensitive, meaning the reading will stop after encountering \\n. It will process the read material (without newline) with the default hash or the hash given by \-\-hash. After hashing, it will be cropped to the key size given by \-s (default 256 bits).
140
141 \fIFrom stdin\fR: Reading will continue until EOF (so using e.g. /dev/random as stdin will not work), with the trailing newline stripped. After that the read data will be hashed with the default hash or the hash given by \-\-hash and the result will be cropped to the keysize given by \-s (default 256 bits). If "plain" is used as an argument to the hash option, the input data will not be hashed.
142 Instead, it will be zero padded (if shorter than the keysize) or truncated (if longer than the keysize) and used directly as the key. No warning will be given if the amount of data read from stdin is less than the keysize.
143
144 \fIFrom a key file\fR: It will be cropped to the size given by \-s. If there is insufficient key material in the key file, cryptsetup will quit with an error.
145
146 If \-\-key-file=- is used for reading the key from stdin, no trailing newline is stripped from the input. Without that option, cryptsetup strips trailing newlines from stdin input.
147 .SH NOTES ON PASSWORD PROCESSING FOR LUKS
148 LUKS uses PBKDF2 to protect against dictionary attacks (see RFC 2898). 
149 LUKS will always use SHA1 in HMAC mode, and no other mode is supported at the moment. 
150 Hence, \-h is ignored.
151
152 LUKS will always do an exhaustive password reading. Hence, password can not be read from /dev/random, /dev/zero or any other stream that does not terminate.
153
154 LUKS saves the processing options when a password is set to the respective key slot.
155 Therefore, no options can be given to luksOpen. 
156 For any password creation action (luksAddKey, or luksFormat), the user may specify how much the time the password processing should consume.
157 Increasing the time will lead to a more secure password, but also will take luksOpen longer to complete. The default setting of one second is sufficient for good security.
158 .SH NOTES ON PASSWORDS
159 Mathematic can't be bribed. Make sure you keep your passwords safe. There are a few nice tricks for constructing a fallback, when suddenly out of (or after being) blue, your brain refuses to cooperate. These fallbacks are possible with LUKS, as it's only possible with LUKS to have multiple passwords.
160 .SH AUTHORS
161 cryptsetup is written by Christophe Saout <christophe@saout.de>
162 .br
163 LUKS extensions, and man page by Clemens Fruhwirth <clemens@endorphin.org>
164 .SH "COMPATABILITY WITH OLD SUSE TWOFISH PARTITIONS"
165 To read images created with SuSE Linux 9.2's loop_fish2 use \-\-cipher
166 twofish-cbc-null \-s 256 \-h sha512, for images created with even
167 older SuSE Linux use \-\-cipher twofish-cbc-null \-s 192 \-h
168 ripemd160:20
169
170 .SH DEPRECATED ACTIONS
171 .PP
172 \fIreload\fR <name> <device>
173 .IP
174 modifies an active mapping <name>. Same options as for
175 create. 
176 .B WARNING:
177 Do not use this for LUKS devices, as the semantics
178 are identical to the create action, which are totally incompatible
179 with the LUKS key setup. 
180
181 This action is deprected because it proved to be rarely useful.  It is
182 uncommon to change the underlying device, key, or offset on the
183 fly. In case, you really want to do this, you certainly know what you
184 are doing and then you are probably better off with the swiss knive
185 tool for device mapper, namely dmsetup. It provides you with the same
186 functionality, see dmsetup reload.
187 .PP
188 \fIluksDelKey\fR <device> <key slot number>
189 .IP
190 identical to luksKillSlot, but deprecated action name. This option was
191 renamed, as we introduced luksRemoveKey, a softer method for disabling
192 password slots. To make a clear distinction that luksDelKey was more brutal than luksRemoveKey
193
194
195 .SH "REPORTING BUGS"
196 Report bugs to <dm-crypt@saout.de>.
197 .SH COPYRIGHT
198 Copyright \(co 2004 Christophe Saout
199 .br
200 Copyright \(co 2004-2006 Clemens Fruhwirth
201
202 This is free software; see the source for copying conditions.  There is NO
203 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
204 .SH "SEE ALSO"
205
206 dm-crypt website, \fBhttp://www.saout.de/misc/dm-crypt/\fR
207
208 LUKS website, \fBhttp://luks.endorphin.org\fR
209
210 dm-crypt TWiki, \fBhttp://www.saout.de/tikiwiki/tiki-index.php\fR