openssl-enc.1ossl 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
  2. .\"
  3. .\" Standard preamble:
  4. .\" ========================================================================
  5. .de Sp \" Vertical space (when we can't use .PP)
  6. .if t .sp .5v
  7. .if n .sp
  8. ..
  9. .de Vb \" Begin verbatim text
  10. .ft CW
  11. .nf
  12. .ne \\$1
  13. ..
  14. .de Ve \" End verbatim text
  15. .ft R
  16. .fi
  17. ..
  18. .\" Set up some character translations and predefined strings. \*(-- will
  19. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  20. .\" double quote, and \*(R" will give a right double quote. \*(C+ will
  21. .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
  22. .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
  23. .\" nothing in troff, for use with C<>.
  24. .tr \(*W-
  25. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  26. .ie n \{\
  27. . ds -- \(*W-
  28. . ds PI pi
  29. . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  30. . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  31. . ds L" ""
  32. . ds R" ""
  33. . ds C` ""
  34. . ds C' ""
  35. 'br\}
  36. .el\{\
  37. . ds -- \|\(em\|
  38. . ds PI \(*p
  39. . ds L" ``
  40. . ds R" ''
  41. . ds C`
  42. . ds C'
  43. 'br\}
  44. .\"
  45. .\" Escape single quotes in literal strings from groff's Unicode transform.
  46. .ie \n(.g .ds Aq \(aq
  47. .el .ds Aq '
  48. .\"
  49. .\" If the F register is >0, we'll generate index entries on stderr for
  50. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  51. .\" entries marked with X<> in POD. Of course, you'll have to process the
  52. .\" output yourself in some meaningful fashion.
  53. .\"
  54. .\" Avoid warning from groff about undefined register 'F'.
  55. .de IX
  56. ..
  57. .nr rF 0
  58. .if \n(.g .if rF .nr rF 1
  59. .if (\n(rF:(\n(.g==0)) \{\
  60. . if \nF \{\
  61. . de IX
  62. . tm Index:\\$1\t\\n%\t"\\$2"
  63. ..
  64. . if !\nF==2 \{\
  65. . nr % 0
  66. . nr F 2
  67. . \}
  68. . \}
  69. .\}
  70. .rr rF
  71. .\"
  72. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  73. .\" Fear. Run. Save yourself. No user-serviceable parts.
  74. . \" fudge factors for nroff and troff
  75. .if n \{\
  76. . ds #H 0
  77. . ds #V .8m
  78. . ds #F .3m
  79. . ds #[ \f1
  80. . ds #] \fP
  81. .\}
  82. .if t \{\
  83. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  84. . ds #V .6m
  85. . ds #F 0
  86. . ds #[ \&
  87. . ds #] \&
  88. .\}
  89. . \" simple accents for nroff and troff
  90. .if n \{\
  91. . ds ' \&
  92. . ds ` \&
  93. . ds ^ \&
  94. . ds , \&
  95. . ds ~ ~
  96. . ds /
  97. .\}
  98. .if t \{\
  99. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  100. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  101. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  102. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  103. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  104. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  105. .\}
  106. . \" troff and (daisy-wheel) nroff accents
  107. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  108. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  109. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  110. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  111. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  112. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  113. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  114. .ds ae a\h'-(\w'a'u*4/10)'e
  115. .ds Ae A\h'-(\w'A'u*4/10)'E
  116. . \" corrections for vroff
  117. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  118. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  119. . \" for low resolution devices (crt and lpr)
  120. .if \n(.H>23 .if \n(.V>19 \
  121. \{\
  122. . ds : e
  123. . ds 8 ss
  124. . ds o a
  125. . ds d- d\h'-1'\(ga
  126. . ds D- D\h'-1'\(hy
  127. . ds th \o'bp'
  128. . ds Th \o'LP'
  129. . ds ae ae
  130. . ds Ae AE
  131. .\}
  132. .rm #[ #] #H #V #F C
  133. .\" ========================================================================
  134. .\"
  135. .IX Title "OPENSSL-ENC 1ossl"
  136. .TH OPENSSL-ENC 1ossl "2025-06-29" "3.3.2" "OpenSSL"
  137. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  138. .\" way too many mistakes in technical documents.
  139. .if n .ad l
  140. .nh
  141. .SH "NAME"
  142. openssl\-enc \- symmetric cipher routines
  143. .SH "SYNOPSIS"
  144. .IX Header "SYNOPSIS"
  145. \&\fBopenssl\fR \fBenc\fR|\fIcipher\fR
  146. [\fB\-\f(BIcipher\fB\fR]
  147. [\fB\-help\fR]
  148. [\fB\-list\fR]
  149. [\fB\-ciphers\fR]
  150. [\fB\-in\fR \fIfilename\fR]
  151. [\fB\-out\fR \fIfilename\fR]
  152. [\fB\-pass\fR \fIarg\fR]
  153. [\fB\-e\fR]
  154. [\fB\-d\fR]
  155. [\fB\-a\fR]
  156. [\fB\-base64\fR]
  157. [\fB\-A\fR]
  158. [\fB\-k\fR \fIpassword\fR]
  159. [\fB\-kfile\fR \fIfilename\fR]
  160. [\fB\-K\fR \fIkey\fR]
  161. [\fB\-iv\fR \fI\s-1IV\s0\fR]
  162. [\fB\-S\fR \fIsalt\fR]
  163. [\fB\-salt\fR]
  164. [\fB\-nosalt\fR]
  165. [\fB\-z\fR]
  166. [\fB\-md\fR \fIdigest\fR]
  167. [\fB\-iter\fR \fIcount\fR]
  168. [\fB\-pbkdf2\fR]
  169. [\fB\-saltlen\fR \fIsize\fR]
  170. [\fB\-p\fR]
  171. [\fB\-P\fR]
  172. [\fB\-bufsize\fR \fInumber\fR]
  173. [\fB\-nopad\fR]
  174. [\fB\-v\fR]
  175. [\fB\-debug\fR]
  176. [\fB\-none\fR]
  177. [\fB\-engine\fR \fIid\fR]
  178. [\fB\-rand\fR \fIfiles\fR]
  179. [\fB\-writerand\fR \fIfile\fR]
  180. [\fB\-provider\fR \fIname\fR]
  181. [\fB\-provider\-path\fR \fIpath\fR]
  182. [\fB\-propquery\fR \fIpropq\fR]
  183. .PP
  184. \&\fBopenssl\fR \fIcipher\fR [\fB...\fR]
  185. .SH "DESCRIPTION"
  186. .IX Header "DESCRIPTION"
  187. The symmetric cipher commands allow data to be encrypted or decrypted
  188. using various block and stream ciphers using keys based on passwords
  189. or explicitly provided. Base64 encoding or decoding can also be performed
  190. either by itself or in addition to the encryption or decryption.
  191. .SH "OPTIONS"
  192. .IX Header "OPTIONS"
  193. .IP "\fB\-\f(BIcipher\fB\fR" 4
  194. .IX Item "-cipher"
  195. The cipher to use.
  196. .IP "\fB\-help\fR" 4
  197. .IX Item "-help"
  198. Print out a usage message.
  199. .IP "\fB\-list\fR" 4
  200. .IX Item "-list"
  201. List all supported ciphers.
  202. .IP "\fB\-ciphers\fR" 4
  203. .IX Item "-ciphers"
  204. Alias of \-list to display all supported ciphers.
  205. .IP "\fB\-in\fR \fIfilename\fR" 4
  206. .IX Item "-in filename"
  207. The input filename, standard input by default.
  208. .IP "\fB\-out\fR \fIfilename\fR" 4
  209. .IX Item "-out filename"
  210. The output filename, standard output by default.
  211. .IP "\fB\-pass\fR \fIarg\fR" 4
  212. .IX Item "-pass arg"
  213. The password source. For more information about the format of \fIarg\fR
  214. see \fBopenssl\-passphrase\-options\fR\|(1).
  215. .IP "\fB\-e\fR" 4
  216. .IX Item "-e"
  217. Encrypt the input data: this is the default.
  218. .IP "\fB\-d\fR" 4
  219. .IX Item "-d"
  220. Decrypt the input data.
  221. .IP "\fB\-a\fR" 4
  222. .IX Item "-a"
  223. Base64 process the data. This means that if encryption is taking place
  224. the data is base64 encoded after encryption. If decryption is set then
  225. the input data is base64 decoded before being decrypted.
  226. .Sp
  227. When the \fB\-A\fR option not given,
  228. on encoding a newline is inserted after each 64 characters, and
  229. on decoding a newline is expected among the first 1024 bytes of input.
  230. .IP "\fB\-base64\fR" 4
  231. .IX Item "-base64"
  232. Same as \fB\-a\fR
  233. .IP "\fB\-A\fR" 4
  234. .IX Item "-A"
  235. If the \fB\-a\fR option is set then base64 encoding produces output without any
  236. newline character, and base64 decoding does not require any newlines.
  237. Therefore it can be helpful to use the \fB\-A\fR option when decoding unknown input.
  238. .IP "\fB\-k\fR \fIpassword\fR" 4
  239. .IX Item "-k password"
  240. The password to derive the key from. This is for compatibility with previous
  241. versions of OpenSSL. Superseded by the \fB\-pass\fR argument.
  242. .IP "\fB\-kfile\fR \fIfilename\fR" 4
  243. .IX Item "-kfile filename"
  244. Read the password to derive the key from the first line of \fIfilename\fR.
  245. This is for compatibility with previous versions of OpenSSL. Superseded by
  246. the \fB\-pass\fR argument.
  247. .IP "\fB\-md\fR \fIdigest\fR" 4
  248. .IX Item "-md digest"
  249. Use the specified digest to create the key from the passphrase.
  250. The default algorithm is sha\-256.
  251. .IP "\fB\-iter\fR \fIcount\fR" 4
  252. .IX Item "-iter count"
  253. Use a given number of iterations on the password in deriving the encryption key.
  254. High values increase the time required to brute-force the resulting file.
  255. This option enables the use of \s-1PBKDF2\s0 algorithm to derive the key.
  256. .IP "\fB\-pbkdf2\fR" 4
  257. .IX Item "-pbkdf2"
  258. Use \s-1PBKDF2\s0 algorithm with a default iteration count of 10000
  259. unless otherwise specified by the \fB\-iter\fR command line option.
  260. .IP "\fB\-saltlen\fR" 4
  261. .IX Item "-saltlen"
  262. Set the salt length to use when using the \fB\-pbkdf2\fR option.
  263. For compatibility reasons, the default is 8 bytes.
  264. The maximum value is currently 16 bytes.
  265. If the \fB\-pbkdf2\fR option is not used, then this option is ignored
  266. and a fixed salt length of 8 is used. The salt length used when
  267. encrypting must also be used when decrypting.
  268. .IP "\fB\-nosalt\fR" 4
  269. .IX Item "-nosalt"
  270. Don't use a salt in the key derivation routines. This option \fB\s-1SHOULD NOT\s0\fR be
  271. used except for test purposes or compatibility with ancient versions of
  272. OpenSSL.
  273. .IP "\fB\-salt\fR" 4
  274. .IX Item "-salt"
  275. Use salt (randomly generated or provide with \fB\-S\fR option) when
  276. encrypting, this is the default.
  277. .IP "\fB\-S\fR \fIsalt\fR" 4
  278. .IX Item "-S salt"
  279. The actual salt to use: this must be represented as a string of hex digits.
  280. If this option is used while encrypting, the same exact value will be needed
  281. again during decryption. This salt may be truncated or zero padded to
  282. match the salt length (See \fB\-saltlen\fR).
  283. .IP "\fB\-K\fR \fIkey\fR" 4
  284. .IX Item "-K key"
  285. The actual key to use: this must be represented as a string comprised only
  286. of hex digits. If only the key is specified, the \s-1IV\s0 must additionally specified
  287. using the \fB\-iv\fR option. When both a key and a password are specified, the
  288. key given with the \fB\-K\fR option will be used and the \s-1IV\s0 generated from the
  289. password will be taken. It does not make much sense to specify both key
  290. and password.
  291. .IP "\fB\-iv\fR \fI\s-1IV\s0\fR" 4
  292. .IX Item "-iv IV"
  293. The actual \s-1IV\s0 to use: this must be represented as a string comprised only
  294. of hex digits. When only the key is specified using the \fB\-K\fR option, the
  295. \&\s-1IV\s0 must explicitly be defined. When a password is being specified using
  296. one of the other options, the \s-1IV\s0 is generated from this password.
  297. .IP "\fB\-p\fR" 4
  298. .IX Item "-p"
  299. Print out the key and \s-1IV\s0 used.
  300. .IP "\fB\-P\fR" 4
  301. .IX Item "-P"
  302. Print out the key and \s-1IV\s0 used then immediately exit: don't do any encryption
  303. or decryption.
  304. .IP "\fB\-bufsize\fR \fInumber\fR" 4
  305. .IX Item "-bufsize number"
  306. Set the buffer size for I/O.
  307. .IP "\fB\-nopad\fR" 4
  308. .IX Item "-nopad"
  309. Disable standard block padding.
  310. .IP "\fB\-v\fR" 4
  311. .IX Item "-v"
  312. Verbose print; display some statistics about I/O and buffer sizes.
  313. .IP "\fB\-debug\fR" 4
  314. .IX Item "-debug"
  315. Debug the BIOs used for I/O.
  316. .IP "\fB\-z\fR" 4
  317. .IX Item "-z"
  318. Compress or decompress encrypted data using zlib after encryption or before
  319. decryption. This option exists only if OpenSSL was compiled with the zlib
  320. or zlib-dynamic option.
  321. .IP "\fB\-none\fR" 4
  322. .IX Item "-none"
  323. Use \s-1NULL\s0 cipher (no encryption or decryption of input).
  324. .IP "\fB\-rand\fR \fIfiles\fR, \fB\-writerand\fR \fIfile\fR" 4
  325. .IX Item "-rand files, -writerand file"
  326. See \*(L"Random State Options\*(R" in \fBopenssl\fR\|(1) for details.
  327. .IP "\fB\-provider\fR \fIname\fR" 4
  328. .IX Item "-provider name"
  329. .PD 0
  330. .IP "\fB\-provider\-path\fR \fIpath\fR" 4
  331. .IX Item "-provider-path path"
  332. .IP "\fB\-propquery\fR \fIpropq\fR" 4
  333. .IX Item "-propquery propq"
  334. .PD
  335. See \*(L"Provider Options\*(R" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7).
  336. .IP "\fB\-engine\fR \fIid\fR" 4
  337. .IX Item "-engine id"
  338. See \*(L"Engine Options\*(R" in \fBopenssl\fR\|(1).
  339. This option is deprecated.
  340. .SH "NOTES"
  341. .IX Header "NOTES"
  342. The program can be called either as \f(CW\*(C`openssl \f(CIcipher\f(CW\*(C'\fR or
  343. \&\f(CW\*(C`openssl enc \-\f(CIcipher\f(CW\*(C'\fR. The first form doesn't work with
  344. engine-provided ciphers, because this form is processed before the
  345. configuration file is read and any ENGINEs loaded.
  346. Use the \fBopenssl\-list\fR\|(1) command to get a list of supported ciphers.
  347. .PP
  348. Engines which provide entirely new encryption algorithms (such as the ccgost
  349. engine which provides gost89 algorithm) should be configured in the
  350. configuration file. Engines specified on the command line using \fB\-engine\fR
  351. option can only be used for hardware-assisted implementations of
  352. ciphers which are supported by the OpenSSL core or another engine specified
  353. in the configuration file.
  354. .PP
  355. When the enc command lists supported ciphers, ciphers provided by engines,
  356. specified in the configuration files are listed too.
  357. .PP
  358. A password will be prompted for to derive the key and \s-1IV\s0 if necessary.
  359. .PP
  360. The \fB\-salt\fR option should \fB\s-1ALWAYS\s0\fR be used if the key is being derived
  361. from a password unless you want compatibility with previous versions of
  362. OpenSSL.
  363. .PP
  364. Without the \fB\-salt\fR option it is possible to perform efficient dictionary
  365. attacks on the password and to attack stream cipher encrypted data. The reason
  366. for this is that without the salt the same password always generates the same
  367. encryption key.
  368. .PP
  369. When the salt is generated at random (that means when encrypting using a
  370. passphrase without explicit salt given using \fB\-S\fR option), the first bytes
  371. of the encrypted data are reserved to store the salt for later decrypting.
  372. .PP
  373. Some of the ciphers do not have large keys and others have security
  374. implications if not used correctly. A beginner is advised to just use
  375. a strong block cipher, such as \s-1AES,\s0 in \s-1CBC\s0 mode.
  376. .PP
  377. All the block ciphers normally use PKCS#5 padding, also known as standard
  378. block padding. This allows a rudimentary integrity or password check to
  379. be performed. However, since the chance of random data passing the test
  380. is better than 1 in 256 it isn't a very good test.
  381. .PP
  382. If padding is disabled then the input data must be a multiple of the cipher
  383. block length.
  384. .PP
  385. All \s-1RC2\s0 ciphers have the same key and effective key length.
  386. .PP
  387. Blowfish and \s-1RC5\s0 algorithms use a 128 bit key.
  388. .PP
  389. Please note that OpenSSL 3.0 changed the effect of the \fB\-S\fR option.
  390. Any explicit salt value specified via this option is no longer prepended to the
  391. ciphertext when encrypting, and must again be explicitly provided when decrypting.
  392. Conversely, when the \fB\-S\fR option is used during decryption, the ciphertext
  393. is expected to not have a prepended salt value.
  394. .PP
  395. When using OpenSSL 3.0 or later to decrypt data that was encrypted with an
  396. explicit salt under OpenSSL 1.1.1 do not use the \fB\-S\fR option, the salt will
  397. then be read from the ciphertext.
  398. To generate ciphertext that can be decrypted with OpenSSL 1.1.1 do not use
  399. the \fB\-S\fR option, the salt will be then be generated randomly and prepended
  400. to the output.
  401. .SH "SUPPORTED CIPHERS"
  402. .IX Header "SUPPORTED CIPHERS"
  403. Note that some of these ciphers can be disabled at compile time
  404. and some are available only if an appropriate engine is configured
  405. in the configuration file. The output when invoking this command
  406. with the \fB\-list\fR option (that is \f(CW\*(C`openssl enc \-list\*(C'\fR) is
  407. a list of ciphers, supported by your version of OpenSSL, including
  408. ones provided by configured engines.
  409. .PP
  410. This command does not support authenticated encryption modes
  411. like \s-1CCM\s0 and \s-1GCM,\s0 and will not support such modes in the future.
  412. This is due to having to begin streaming output (e.g., to standard output
  413. when \fB\-out\fR is not used) before the authentication tag could be validated.
  414. When this command is used in a pipeline, the receiving end will not be
  415. able to roll back upon authentication failure. The \s-1AEAD\s0 modes currently in
  416. common use also suffer from catastrophic failure of confidentiality and/or
  417. integrity upon reuse of key/iv/nonce, and since \fBopenssl enc\fR places the
  418. entire burden of key/iv/nonce management upon the user, the risk of
  419. exposing \s-1AEAD\s0 modes is too great to allow. These key/iv/nonce
  420. management issues also affect other modes currently exposed in this command,
  421. but the failure modes are less extreme in these cases, and the
  422. functionality cannot be removed with a stable release branch.
  423. For bulk encryption of data, whether using authenticated encryption
  424. modes or other modes, \fBopenssl\-cms\fR\|(1) is recommended, as it provides a
  425. standard data format and performs the needed key/iv/nonce management.
  426. .PP
  427. When enc is used with key wrapping modes the input data cannot be streamed,
  428. meaning it must be processed in a single pass.
  429. Consequently, the input data size must be less than
  430. the buffer size (\-bufsize arg, default to 8*1024 bytes).
  431. The '*\-wrap' ciphers require the input to be a multiple of 8 bytes long,
  432. because no padding is involved.
  433. The '*\-wrap\-pad' ciphers allow any input length.
  434. In both cases, no \s-1IV\s0 is needed. See example below.
  435. .PP
  436. .Vb 1
  437. \& base64 Base 64
  438. \&
  439. \& bf\-cbc Blowfish in CBC mode
  440. \& bf Alias for bf\-cbc
  441. \& blowfish Alias for bf\-cbc
  442. \& bf\-cfb Blowfish in CFB mode
  443. \& bf\-ecb Blowfish in ECB mode
  444. \& bf\-ofb Blowfish in OFB mode
  445. \&
  446. \& cast\-cbc CAST in CBC mode
  447. \& cast Alias for cast\-cbc
  448. \& cast5\-cbc CAST5 in CBC mode
  449. \& cast5\-cfb CAST5 in CFB mode
  450. \& cast5\-ecb CAST5 in ECB mode
  451. \& cast5\-ofb CAST5 in OFB mode
  452. \&
  453. \& chacha20 ChaCha20 algorithm
  454. \&
  455. \& des\-cbc DES in CBC mode
  456. \& des Alias for des\-cbc
  457. \& des\-cfb DES in CFB mode
  458. \& des\-ofb DES in OFB mode
  459. \& des\-ecb DES in ECB mode
  460. \&
  461. \& des\-ede\-cbc Two key triple DES EDE in CBC mode
  462. \& des\-ede Two key triple DES EDE in ECB mode
  463. \& des\-ede\-cfb Two key triple DES EDE in CFB mode
  464. \& des\-ede\-ofb Two key triple DES EDE in OFB mode
  465. \&
  466. \& des\-ede3\-cbc Three key triple DES EDE in CBC mode
  467. \& des\-ede3 Three key triple DES EDE in ECB mode
  468. \& des3 Alias for des\-ede3\-cbc
  469. \& des\-ede3\-cfb Three key triple DES EDE CFB mode
  470. \& des\-ede3\-ofb Three key triple DES EDE in OFB mode
  471. \&
  472. \& desx DESX algorithm.
  473. \&
  474. \& gost89 GOST 28147\-89 in CFB mode (provided by ccgost engine)
  475. \& gost89\-cnt GOST 28147\-89 in CNT mode (provided by ccgost engine)
  476. \&
  477. \& idea\-cbc IDEA algorithm in CBC mode
  478. \& idea same as idea\-cbc
  479. \& idea\-cfb IDEA in CFB mode
  480. \& idea\-ecb IDEA in ECB mode
  481. \& idea\-ofb IDEA in OFB mode
  482. \&
  483. \& rc2\-cbc 128 bit RC2 in CBC mode
  484. \& rc2 Alias for rc2\-cbc
  485. \& rc2\-cfb 128 bit RC2 in CFB mode
  486. \& rc2\-ecb 128 bit RC2 in ECB mode
  487. \& rc2\-ofb 128 bit RC2 in OFB mode
  488. \& rc2\-64\-cbc 64 bit RC2 in CBC mode
  489. \& rc2\-40\-cbc 40 bit RC2 in CBC mode
  490. \&
  491. \& rc4 128 bit RC4
  492. \& rc4\-64 64 bit RC4
  493. \& rc4\-40 40 bit RC4
  494. \&
  495. \& rc5\-cbc RC5 cipher in CBC mode
  496. \& rc5 Alias for rc5\-cbc
  497. \& rc5\-cfb RC5 cipher in CFB mode
  498. \& rc5\-ecb RC5 cipher in ECB mode
  499. \& rc5\-ofb RC5 cipher in OFB mode
  500. \&
  501. \& seed\-cbc SEED cipher in CBC mode
  502. \& seed Alias for seed\-cbc
  503. \& seed\-cfb SEED cipher in CFB mode
  504. \& seed\-ecb SEED cipher in ECB mode
  505. \& seed\-ofb SEED cipher in OFB mode
  506. \&
  507. \& sm4\-cbc SM4 cipher in CBC mode
  508. \& sm4 Alias for sm4\-cbc
  509. \& sm4\-cfb SM4 cipher in CFB mode
  510. \& sm4\-ctr SM4 cipher in CTR mode
  511. \& sm4\-ecb SM4 cipher in ECB mode
  512. \& sm4\-ofb SM4 cipher in OFB mode
  513. \&
  514. \& aes\-[128|192|256]\-cbc 128/192/256 bit AES in CBC mode
  515. \& aes[128|192|256] Alias for aes\-[128|192|256]\-cbc
  516. \& aes\-[128|192|256]\-cfb 128/192/256 bit AES in 128 bit CFB mode
  517. \& aes\-[128|192|256]\-cfb1 128/192/256 bit AES in 1 bit CFB mode
  518. \& aes\-[128|192|256]\-cfb8 128/192/256 bit AES in 8 bit CFB mode
  519. \& aes\-[128|192|256]\-ctr 128/192/256 bit AES in CTR mode
  520. \& aes\-[128|192|256]\-ecb 128/192/256 bit AES in ECB mode
  521. \& aes\-[128|192|256]\-ofb 128/192/256 bit AES in OFB mode
  522. \&
  523. \& aes\-[128|192|256]\-wrap key wrapping using 128/192/256 bit AES
  524. \& aes\-[128|192|256]\-wrap\-pad key wrapping with padding using 128/192/256 bit AES
  525. \&
  526. \& aria\-[128|192|256]\-cbc 128/192/256 bit ARIA in CBC mode
  527. \& aria[128|192|256] Alias for aria\-[128|192|256]\-cbc
  528. \& aria\-[128|192|256]\-cfb 128/192/256 bit ARIA in 128 bit CFB mode
  529. \& aria\-[128|192|256]\-cfb1 128/192/256 bit ARIA in 1 bit CFB mode
  530. \& aria\-[128|192|256]\-cfb8 128/192/256 bit ARIA in 8 bit CFB mode
  531. \& aria\-[128|192|256]\-ctr 128/192/256 bit ARIA in CTR mode
  532. \& aria\-[128|192|256]\-ecb 128/192/256 bit ARIA in ECB mode
  533. \& aria\-[128|192|256]\-ofb 128/192/256 bit ARIA in OFB mode
  534. \&
  535. \& camellia\-[128|192|256]\-cbc 128/192/256 bit Camellia in CBC mode
  536. \& camellia[128|192|256] Alias for camellia\-[128|192|256]\-cbc
  537. \& camellia\-[128|192|256]\-cfb 128/192/256 bit Camellia in 128 bit CFB mode
  538. \& camellia\-[128|192|256]\-cfb1 128/192/256 bit Camellia in 1 bit CFB mode
  539. \& camellia\-[128|192|256]\-cfb8 128/192/256 bit Camellia in 8 bit CFB mode
  540. \& camellia\-[128|192|256]\-ctr 128/192/256 bit Camellia in CTR mode
  541. \& camellia\-[128|192|256]\-ecb 128/192/256 bit Camellia in ECB mode
  542. \& camellia\-[128|192|256]\-ofb 128/192/256 bit Camellia in OFB mode
  543. .Ve
  544. .SH "EXAMPLES"
  545. .IX Header "EXAMPLES"
  546. Just base64 encode a binary file:
  547. .PP
  548. .Vb 1
  549. \& openssl base64 \-in file.bin \-out file.b64
  550. .Ve
  551. .PP
  552. Decode the same file
  553. .PP
  554. .Vb 1
  555. \& openssl base64 \-d \-in file.b64 \-out file.bin
  556. .Ve
  557. .PP
  558. Encrypt a file using \s-1AES\-128\s0 using a prompted password
  559. and \s-1PBKDF2\s0 key derivation:
  560. .PP
  561. .Vb 1
  562. \& openssl enc \-aes128 \-pbkdf2 \-in file.txt \-out file.aes128
  563. .Ve
  564. .PP
  565. Decrypt a file using a supplied password:
  566. .PP
  567. .Vb 2
  568. \& openssl enc \-aes128 \-pbkdf2 \-d \-in file.aes128 \-out file.txt \e
  569. \& \-pass pass:<password>
  570. .Ve
  571. .PP
  572. Encrypt a file then base64 encode it (so it can be sent via mail for example)
  573. using \s-1AES\-256\s0 in \s-1CTR\s0 mode and \s-1PBKDF2\s0 key derivation:
  574. .PP
  575. .Vb 1
  576. \& openssl enc \-aes\-256\-ctr \-pbkdf2 \-a \-in file.txt \-out file.aes256
  577. .Ve
  578. .PP
  579. Base64 decode a file then decrypt it using a password supplied in a file:
  580. .PP
  581. .Vb 2
  582. \& openssl enc \-aes\-256\-ctr \-pbkdf2 \-d \-a \-in file.aes256 \-out file.txt \e
  583. \& \-pass file:<passfile>
  584. .Ve
  585. .PP
  586. \&\s-1AES\s0 key wrapping:
  587. .PP
  588. .Vb 3
  589. \& openssl enc \-e \-a \-id\-aes128\-wrap\-pad \-K 000102030405060708090A0B0C0D0E0F \-in file.bin
  590. \&or
  591. \& openssl aes128\-wrap\-pad \-e \-a \-K 000102030405060708090A0B0C0D0E0F \-in file.bin
  592. .Ve
  593. .SH "BUGS"
  594. .IX Header "BUGS"
  595. The \fB\-A\fR option when used with large files doesn't work properly.
  596. On the other hand, when base64 decoding without the \fB\-A\fR option,
  597. if the first 1024 bytes of input do not include a newline character
  598. the first two lines of input are ignored.
  599. .PP
  600. The \fBopenssl enc\fR command only supports a fixed number of algorithms with
  601. certain parameters. So if, for example, you want to use \s-1RC2\s0 with a
  602. 76 bit key or \s-1RC4\s0 with an 84 bit key you can't use this program.
  603. .SH "HISTORY"
  604. .IX Header "HISTORY"
  605. The default digest was changed from \s-1MD5\s0 to \s-1SHA256\s0 in OpenSSL 1.1.0.
  606. .PP
  607. The \fB\-list\fR option was added in OpenSSL 1.1.1e.
  608. .PP
  609. The \fB\-ciphers\fR and \fB\-engine\fR options were deprecated in OpenSSL 3.0.
  610. .PP
  611. The \fB\-saltlen\fR option was added in OpenSSL 3.2.
  612. .SH "COPYRIGHT"
  613. .IX Header "COPYRIGHT"
  614. Copyright 2000\-2024 The OpenSSL Project Authors. All Rights Reserved.
  615. .PP
  616. Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use
  617. this file except in compliance with the License. You can obtain a copy
  618. in the file \s-1LICENSE\s0 in the source distribution or at
  619. <https://www.openssl.org/source/license.html>.