1puttygen(1) PuTTY tool suite puttygen(1)
2
3
4
6 puttygen - public-key generator for the PuTTY tools
7
9 puttygen ( keyfile | -t keytype [ -b bits ] [ --primes method ] [ -q ] )
10 [ -C new-comment ] [ -P ] [ --reencrypt ]
11 [ -O output-type | -l | -L | -p | --dump ] [ -E fptype ]
12 [ --ppk-param key=value,... ]
13 [ -o output-file ]
14
16 puttygen is a tool to generate and manipulate SSH public and private
17 key pairs. It is part of the PuTTY suite, although it can also interop‐
18 erate with the key formats used by some other SSH clients.
19
20 When you run puttygen, it does three things. Firstly, it either loads
21 an existing key file (if you specified keyfile), or generates a new key
22 (if you specified keytype). Then, it optionally makes modifications to
23 the key (such as changing the comment and/or the passphrase); finally,
24 it outputs the key, or some information about the key, to a file.
25
26 All three of these phases are controlled by the options described in
27 the following section.
28
30 In the first phase, puttygen either loads or generates a key. Note that
31 generating a key requires random data, which can cause puttygen to
32 pause, possibly for some time if your system does not have much random‐
33 ness available.
34
35 The options to control this phase are:
36
37 keyfile
38 Specify a key file to be loaded. (Use `-' to read a key file
39 from standard input.)
40
41 Usually this will be a private key, which can be in the (de
42 facto standard) SSH-1 key format, or in PuTTY's SSH-2 key for‐
43 mat, or in either of the SSH-2 private key formats used by
44 OpenSSH and ssh.com's implementation.
45
46 You can also specify a file containing only a public key here.
47 The operations you can do are limited to outputting another pub‐
48 lic key format or a fingerprint. Public keys can be in RFC 4716
49 or OpenSSH format, or the standard SSH-1 format.
50
51 -t keytype
52 Specify a type of key to generate. The acceptable values here
53 are rsa, dsa, ecdsa, eddsa, ed25519, and ed448 (to generate
54 SSH-2 keys), and rsa1 (to generate SSH-1 keys).
55
56 -b bits
57 Specify the size of the key to generate, in bits. Default for
58 rsa and dsa keys is 2048.
59
60 --primes method
61 Method for generating prime numbers. The acceptable values here
62 are probable (the default), proven, and proven-even; the later
63 methods are slower. (Various synonyms for these method names are
64 also accepted.)
65
66 The `probable primes' method sounds unsafe, but it's the most
67 commonly used prime-generation strategy. There is in theory a
68 possibility that it might accidentally generate a number that
69 isn't prime, but the software does enough checking to make that
70 probability vanishingly small (less than 1 in 2^80, or 1 in
71 10^24). So, in practice, nobody worries about it very much.
72
73 The other methods cause PuTTYgen to use numbers that it is sure
74 are prime, because it generates the output number together with
75 a proof of its primality. This takes more effort, but it elimi‐
76 nates that theoretical risk in the probabilistic method.
77
78 You might choose to switch from probable to proven primes if you
79 have a local security standard that demands it, or if you don't
80 trust the probabilistic argument for the safety of the usual
81 method.
82
83 --strong-rsa
84 When generating an RSA key, make sure the prime factors of the
85 key modulus are `strong primes'. A strong prime is a prime num‐
86 ber chosen to have a particular structure that makes certain
87 factoring algorithms more difficult to apply, so some security
88 standards recommend their use. However, the most modern factor‐
89 ing algorithms are unaffected, so this option is probably not
90 worth turning on unless you have a local standard that recom‐
91 mends it.
92
93 -q Suppress the progress display when generating a new key.
94
95 --old-passphrase file
96 Specify a file name; the first line will be read from this file
97 (removing any trailing newline) and used as the old passphrase.
98 CAUTION: If the passphrase is important, the file should be
99 stored on a temporary filesystem or else securely erased after
100 use.
101
102 --random-device device
103 Specify device to read entropy from. By default, puttygen uses
104 /dev/urandom, falling back to /dev/random if it has to.
105
106 In the second phase, puttygen optionally alters properties of the key
107 it has loaded or generated. The options to control this are:
108
109 -C new-comment
110 Specify a comment string to describe the key. This comment
111 string will be used by PuTTY to identify the key to you (when
112 asking you to enter the passphrase, for example, so that you
113 know which passphrase to type).
114
115 -P Indicate that you want to change the key's passphrase. This is
116 automatic when you are generating a new key, but not when you
117 are modifying an existing key.
118
119 --reencrypt
120 For an existing private key saved with a passphrase, refresh the
121 encryption without changing the passphrase.
122
123 This is most likely to be useful with the --ppk-param option, to
124 change some aspect of the key file's format or encryption.
125
126 --ppk-param key=value,...
127 When saving a PPK file (the default private output type for
128 SSH-2 keys), adjust details of the on-disk format.
129
130 Aspects to change are specified as a series of key=value pairs
131 separated by commas. The keys are:
132
133 version
134 The PPK format version. Possible values are 3 (the de‐
135 fault) and 2 (which is less resistant to brute-force de‐
136 cryption, but which you might need if your key needs to
137 be used by old versions of PuTTY tools, or other PPK con‐
138 sumers).
139
140 The following keys only affect PPK version 3 files.
141
142 kdf The variant of the Argon2 key derivation function to use.
143 Options are argon2id (default, and recommended), argon2i,
144 and argon2d.
145
146 You might change this if you consider your exposure to
147 side-channel attacks to be different to the norm.
148
149 memory The amount of memory needed to decrypt the key, in Kbyte.
150 Default is 8192 (i.e., 8 Mbyte).
151
152 time Approximate time, on this machine, required to attempt
153 decrypting the key, in milliseconds. Default is 100 (ms).
154
155 passes Alternative to time: explicitly specify the number of
156 hash passes required to attempt decrypting the key.
157
158 parallelism
159 Number of parallelisable threads that can be used to de‐
160 crypt the key. Default is 1 (force decryption to run sin‐
161 gle-threaded).
162
163 In the third phase, puttygen saves the key or information about it. The
164 options to control this are:
165
166 -O output-type
167 Specify the type of output you want puttygen to produce. Accept‐
168 able options are:
169
170 private
171 Save the private key in a format usable by PuTTY. This
172 will either be the standard SSH-1 key format, or PuTTY's
173 own SSH-2 key format (`PPK'). This is the default.
174
175 public Save the public key only. For SSH-1 keys, the standard
176 public key format will be used (`1024 37 5698745...').
177 For SSH-2 keys, the public key will be output in the for‐
178 mat specified by RFC 4716, which is a multi-line text
179 file beginning with the line `---- BEGIN SSH2 PUBLIC KEY
180 ----'.
181
182 public-openssh
183 Save the public key only, in a format usable by OpenSSH.
184 For SSH-1 keys, this output format behaves identically to
185 public. For SSH-2 keys, the public key will be output in
186 the OpenSSH format, which is a single line (`ssh-rsa
187 AAAAB3NzaC1yc2...').
188
189 fingerprint
190 Print a fingerprint of the public key. The -E option lets
191 you specify which fingerprinting algorithm to use. All
192 algorithms are believed compatible with OpenSSH.
193
194 private-openssh
195 Save an SSH-2 private key in OpenSSH's format, using the
196 oldest format available to maximise backward compatibil‐
197 ity. This option is not permitted for SSH-1 keys.
198
199 private-openssh-new
200 As private-openssh, except that it forces the use of
201 OpenSSH's newer format even for RSA, DSA, and ECDSA keys.
202
203 private-sshcom
204 Save an SSH-2 private key in ssh.com's format. This op‐
205 tion is not permitted for SSH-1 keys.
206
207 text Save a textual dump of the numeric components comprising
208 the key (both the public and private parts, if present).
209 Useful for debugging, or for using PuTTYgen as a key gen‐
210 erator for applications other than SSH.
211
212 The output consists of a series of name=value lines,
213 where each value is either a C-like string literal in
214 double quotes, or a hexadecimal number starting with
215 0x...
216
217 If no output type is specified, the default is private.
218
219 -o output-file
220 Specify the file where puttygen should write its output. If this
221 option is not specified, puttygen will assume you want to over‐
222 write the original file if the input and output file types are
223 the same (changing a comment or passphrase), and will assume you
224 want to output to stdout if you are asking for a public key or
225 fingerprint. Otherwise, the -o option is required.
226
227 -l Synonym for `-O fingerprint'.
228
229 -L Synonym for `-O public-openssh'.
230
231 -p Synonym for `-O public'.
232
233 --dump Synonym for `-O text'.
234
235 -E fptype
236 Specify the algorithm to use if generating a fingerprint. The
237 options are sha256 (the default) and md5.
238
239 --new-passphrase file
240 Specify a file name; the first line will be read from this file
241 (removing any trailing newline) and used as the new passphrase.
242 If the file is empty then the saved key will be unencrypted.
243 CAUTION: If the passphrase is important, the file should be
244 stored on a temporary filesystem or else securely erased after
245 use.
246
247 The following options do not run PuTTYgen as normal, but print informa‐
248 tional messages and then quit:
249
250 -h, --help
251 Display a message summarizing the available options.
252
253 -V, --version
254 Display the version of PuTTYgen.
255
256 --pgpfp
257 Display the fingerprints of the PuTTY PGP Master Keys, to aid in
258 verifying new files released by the PuTTY team.
259
261 To generate an SSH-2 RSA key pair and save it in PuTTY's own format
262 (you will be prompted for the passphrase):
263
264 puttygen -t rsa -C "my home key" -o mykey.ppk
265
266 To generate a larger (4096-bit) key:
267
268 puttygen -t rsa -b 4096 -C "my home key" -o mykey.ppk
269
270 To change the passphrase on a key (you will be prompted for the old and
271 new passphrases):
272
273 puttygen -P mykey.ppk
274
275 To change the comment on a key:
276
277 puttygen -C "new comment" mykey.ppk
278
279 To convert a key into OpenSSH's private key format:
280
281 puttygen mykey.ppk -O private-openssh -o my-openssh-key
282
283 To convert a key from another format (puttygen will automatically de‐
284 tect the input key type):
285
286 puttygen my-ssh.com-key -o mykey.ppk
287
288 To display the SHA-256 fingerprint of a key (some key types require a
289 passphrase to extract even this much information):
290
291 puttygen -l mykey.ppk
292
293 To add the OpenSSH-format public half of a key to your authorised keys
294 file:
295
296 puttygen -L mykey.ppk >> $HOME/.ssh/authorized_keys
297
298
299
300PuTTY tool suite 2004‐03‐24 puttygen(1)