openssl-enc.1ossl 20 KB

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