ciphers.pod 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. =pod
  2. =head1 NAME
  3. ciphers - SSL cipher display and cipher list tool.
  4. =head1 SYNOPSIS
  5. B<openssl> B<ciphers>
  6. [B<-v>]
  7. [B<-V>]
  8. [B<-ssl2>]
  9. [B<-ssl3>]
  10. [B<-tls1>]
  11. [B<cipherlist>]
  12. =head1 DESCRIPTION
  13. The B<ciphers> command converts textual OpenSSL cipher lists into ordered
  14. SSL cipher preference lists. It can be used as a test tool to determine
  15. the appropriate cipherlist.
  16. =head1 COMMAND OPTIONS
  17. =over 4
  18. =item B<-v>
  19. Verbose option. List ciphers with a complete description of
  20. protocol version (SSLv2 or SSLv3; the latter includes TLS), key exchange,
  21. authentication, encryption and mac algorithms used along with any key size
  22. restrictions and whether the algorithm is classed as an "export" cipher.
  23. Note that without the B<-v> option, ciphers may seem to appear twice
  24. in a cipher list; this is when similar ciphers are available for
  25. SSL v2 and for SSL v3/TLS v1.
  26. =item B<-V>
  27. Like B<-V>, but include cipher suite codes in output (hex format).
  28. =item B<-ssl3>
  29. only include SSL v3 ciphers.
  30. =item B<-ssl2>
  31. only include SSL v2 ciphers.
  32. =item B<-tls1>
  33. only include TLS v1 ciphers.
  34. =item B<-h>, B<-?>
  35. print a brief usage message.
  36. =item B<cipherlist>
  37. a cipher list to convert to a cipher preference list. If it is not included
  38. then the default cipher list will be used. The format is described below.
  39. =back
  40. =head1 CIPHER LIST FORMAT
  41. The cipher list consists of one or more I<cipher strings> separated by colons.
  42. Commas or spaces are also acceptable separators but colons are normally used.
  43. The actual cipher string can take several different forms.
  44. It can consist of a single cipher suite such as B<RC4-SHA>.
  45. It can represent a list of cipher suites containing a certain algorithm, or
  46. cipher suites of a certain type. For example B<SHA1> represents all ciphers
  47. suites using the digest algorithm SHA1 and B<SSLv3> represents all SSL v3
  48. algorithms.
  49. Lists of cipher suites can be combined in a single cipher string using the
  50. B<+> character. This is used as a logical B<and> operation. For example
  51. B<SHA1+DES> represents all cipher suites containing the SHA1 B<and> the DES
  52. algorithms.
  53. Each cipher string can be optionally preceded by the characters B<!>,
  54. B<-> or B<+>.
  55. If B<!> is used then the ciphers are permanently deleted from the list.
  56. The ciphers deleted can never reappear in the list even if they are
  57. explicitly stated.
  58. If B<-> is used then the ciphers are deleted from the list, but some or
  59. all of the ciphers can be added again by later options.
  60. If B<+> is used then the ciphers are moved to the end of the list. This
  61. option doesn't add any new ciphers it just moves matching existing ones.
  62. If none of these characters is present then the string is just interpreted
  63. as a list of ciphers to be appended to the current preference list. If the
  64. list includes any ciphers already present they will be ignored: that is they
  65. will not moved to the end of the list.
  66. Additionally the cipher string B<@STRENGTH> can be used at any point to sort
  67. the current cipher list in order of encryption algorithm key length.
  68. =head1 CIPHER STRINGS
  69. The following is a list of all permitted cipher strings and their meanings.
  70. =over 4
  71. =item B<DEFAULT>
  72. the default cipher list. This is determined at compile time and, as of OpenSSL
  73. 1.0.0, is normally B<ALL:!aNULL:!eNULL>. This must be the first cipher string
  74. specified.
  75. =item B<COMPLEMENTOFDEFAULT>
  76. the ciphers included in B<ALL>, but not enabled by default. Currently
  77. this is B<ADH>. Note that this rule does not cover B<eNULL>, which is
  78. not included by B<ALL> (use B<COMPLEMENTOFALL> if necessary).
  79. =item B<ALL>
  80. all cipher suites except the B<eNULL> ciphers which must be explicitly enabled;
  81. as of OpenSSL, the B<ALL> cipher suites are reasonably ordered by default
  82. =item B<COMPLEMENTOFALL>
  83. the cipher suites not enabled by B<ALL>, currently being B<eNULL>.
  84. =item B<HIGH>
  85. "high" encryption cipher suites. This currently means those with key lengths larger
  86. than 128 bits, and some cipher suites with 128-bit keys.
  87. =item B<MEDIUM>
  88. "medium" encryption cipher suites, currently some of those using 128 bit encryption.
  89. =item B<LOW>
  90. "low" encryption cipher suites, currently those using 64 or 56 bit encryption algorithms
  91. but excluding export cipher suites.
  92. =item B<EXP>, B<EXPORT>
  93. export encryption algorithms. Including 40 and 56 bits algorithms.
  94. =item B<EXPORT40>
  95. 40 bit export encryption algorithms
  96. =item B<EXPORT56>
  97. 56 bit export encryption algorithms. In OpenSSL 0.9.8c and later the set of
  98. 56 bit export ciphers is empty unless OpenSSL has been explicitly configured
  99. with support for experimental ciphers.
  100. =item B<eNULL>, B<NULL>
  101. the "NULL" ciphers that is those offering no encryption. Because these offer no
  102. encryption at all and are a security risk they are disabled unless explicitly
  103. included.
  104. =item B<aNULL>
  105. the cipher suites offering no authentication. This is currently the anonymous
  106. DH algorithms. These cipher suites are vulnerable to a "man in the middle"
  107. attack and so their use is normally discouraged.
  108. =item B<kRSA>, B<RSA>
  109. cipher suites using RSA key exchange.
  110. =item B<kEDH>
  111. cipher suites using ephemeral DH key agreement.
  112. =item B<kDHr>, B<kDHd>
  113. cipher suites using DH key agreement and DH certificates signed by CAs with RSA
  114. and DSS keys respectively. Not implemented.
  115. =item B<aRSA>
  116. cipher suites using RSA authentication, i.e. the certificates carry RSA keys.
  117. =item B<aDSS>, B<DSS>
  118. cipher suites using DSS authentication, i.e. the certificates carry DSS keys.
  119. =item B<aDH>
  120. cipher suites effectively using DH authentication, i.e. the certificates carry
  121. DH keys. Not implemented.
  122. =item B<kFZA>, B<aFZA>, B<eFZA>, B<FZA>
  123. ciphers suites using FORTEZZA key exchange, authentication, encryption or all
  124. FORTEZZA algorithms. Not implemented.
  125. =item B<TLSv1>, B<SSLv3>, B<SSLv2>
  126. TLS v1.0, SSL v3.0 or SSL v2.0 cipher suites respectively.
  127. =item B<DH>
  128. cipher suites using DH, including anonymous DH.
  129. =item B<ADH>
  130. anonymous DH cipher suites.
  131. =item B<AES>
  132. cipher suites using AES.
  133. =item B<CAMELLIA>
  134. cipher suites using Camellia.
  135. =item B<3DES>
  136. cipher suites using triple DES.
  137. =item B<DES>
  138. cipher suites using DES (not triple DES).
  139. =item B<RC4>
  140. cipher suites using RC4.
  141. =item B<RC2>
  142. cipher suites using RC2.
  143. =item B<IDEA>
  144. cipher suites using IDEA.
  145. =item B<SEED>
  146. cipher suites using SEED.
  147. =item B<MD5>
  148. cipher suites using MD5.
  149. =item B<SHA1>, B<SHA>
  150. cipher suites using SHA1.
  151. =item B<aGOST>
  152. cipher suites using GOST R 34.10 (either 2001 or 94) for authenticaction
  153. (needs an engine supporting GOST algorithms).
  154. =item B<aGOST01>
  155. cipher suites using GOST R 34.10-2001 authentication.
  156. =item B<aGOST94>
  157. cipher suites using GOST R 34.10-94 authentication (note that R 34.10-94
  158. standard has been expired so use GOST R 34.10-2001)
  159. =item B<kGOST>
  160. cipher suites, using VKO 34.10 key exchange, specified in the RFC 4357.
  161. =item B<GOST94>
  162. cipher suites, using HMAC based on GOST R 34.11-94.
  163. =item B<GOST89MAC>
  164. cipher suites using GOST 28147-89 MAC B<instead of> HMAC.
  165. =back
  166. =head1 CIPHER SUITE NAMES
  167. The following lists give the SSL or TLS cipher suites names from the
  168. relevant specification and their OpenSSL equivalents. It should be noted,
  169. that several cipher suite names do not include the authentication used,
  170. e.g. DES-CBC3-SHA. In these cases, RSA authentication is used.
  171. =head2 SSL v3.0 cipher suites.
  172. SSL_RSA_WITH_NULL_MD5 NULL-MD5
  173. SSL_RSA_WITH_NULL_SHA NULL-SHA
  174. SSL_RSA_EXPORT_WITH_RC4_40_MD5 EXP-RC4-MD5
  175. SSL_RSA_WITH_RC4_128_MD5 RC4-MD5
  176. SSL_RSA_WITH_RC4_128_SHA RC4-SHA
  177. SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5 EXP-RC2-CBC-MD5
  178. SSL_RSA_WITH_IDEA_CBC_SHA IDEA-CBC-SHA
  179. SSL_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-DES-CBC-SHA
  180. SSL_RSA_WITH_DES_CBC_SHA DES-CBC-SHA
  181. SSL_RSA_WITH_3DES_EDE_CBC_SHA DES-CBC3-SHA
  182. SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA Not implemented.
  183. SSL_DH_DSS_WITH_DES_CBC_SHA Not implemented.
  184. SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA Not implemented.
  185. SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA Not implemented.
  186. SSL_DH_RSA_WITH_DES_CBC_SHA Not implemented.
  187. SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA Not implemented.
  188. SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-DSS-DES-CBC-SHA
  189. SSL_DHE_DSS_WITH_DES_CBC_SHA EDH-DSS-CBC-SHA
  190. SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA EDH-DSS-DES-CBC3-SHA
  191. SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-RSA-DES-CBC-SHA
  192. SSL_DHE_RSA_WITH_DES_CBC_SHA EDH-RSA-DES-CBC-SHA
  193. SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA EDH-RSA-DES-CBC3-SHA
  194. SSL_DH_anon_EXPORT_WITH_RC4_40_MD5 EXP-ADH-RC4-MD5
  195. SSL_DH_anon_WITH_RC4_128_MD5 ADH-RC4-MD5
  196. SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA EXP-ADH-DES-CBC-SHA
  197. SSL_DH_anon_WITH_DES_CBC_SHA ADH-DES-CBC-SHA
  198. SSL_DH_anon_WITH_3DES_EDE_CBC_SHA ADH-DES-CBC3-SHA
  199. SSL_FORTEZZA_KEA_WITH_NULL_SHA Not implemented.
  200. SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA Not implemented.
  201. SSL_FORTEZZA_KEA_WITH_RC4_128_SHA Not implemented.
  202. =head2 TLS v1.0 cipher suites.
  203. TLS_RSA_WITH_NULL_MD5 NULL-MD5
  204. TLS_RSA_WITH_NULL_SHA NULL-SHA
  205. TLS_RSA_EXPORT_WITH_RC4_40_MD5 EXP-RC4-MD5
  206. TLS_RSA_WITH_RC4_128_MD5 RC4-MD5
  207. TLS_RSA_WITH_RC4_128_SHA RC4-SHA
  208. TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 EXP-RC2-CBC-MD5
  209. TLS_RSA_WITH_IDEA_CBC_SHA IDEA-CBC-SHA
  210. TLS_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-DES-CBC-SHA
  211. TLS_RSA_WITH_DES_CBC_SHA DES-CBC-SHA
  212. TLS_RSA_WITH_3DES_EDE_CBC_SHA DES-CBC3-SHA
  213. TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA Not implemented.
  214. TLS_DH_DSS_WITH_DES_CBC_SHA Not implemented.
  215. TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA Not implemented.
  216. TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA Not implemented.
  217. TLS_DH_RSA_WITH_DES_CBC_SHA Not implemented.
  218. TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA Not implemented.
  219. TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-DSS-DES-CBC-SHA
  220. TLS_DHE_DSS_WITH_DES_CBC_SHA EDH-DSS-CBC-SHA
  221. TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA EDH-DSS-DES-CBC3-SHA
  222. TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA EXP-EDH-RSA-DES-CBC-SHA
  223. TLS_DHE_RSA_WITH_DES_CBC_SHA EDH-RSA-DES-CBC-SHA
  224. TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA EDH-RSA-DES-CBC3-SHA
  225. TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 EXP-ADH-RC4-MD5
  226. TLS_DH_anon_WITH_RC4_128_MD5 ADH-RC4-MD5
  227. TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA EXP-ADH-DES-CBC-SHA
  228. TLS_DH_anon_WITH_DES_CBC_SHA ADH-DES-CBC-SHA
  229. TLS_DH_anon_WITH_3DES_EDE_CBC_SHA ADH-DES-CBC3-SHA
  230. =head2 AES ciphersuites from RFC3268, extending TLS v1.0
  231. TLS_RSA_WITH_AES_128_CBC_SHA AES128-SHA
  232. TLS_RSA_WITH_AES_256_CBC_SHA AES256-SHA
  233. TLS_DH_DSS_WITH_AES_128_CBC_SHA Not implemented.
  234. TLS_DH_DSS_WITH_AES_256_CBC_SHA Not implemented.
  235. TLS_DH_RSA_WITH_AES_128_CBC_SHA Not implemented.
  236. TLS_DH_RSA_WITH_AES_256_CBC_SHA Not implemented.
  237. TLS_DHE_DSS_WITH_AES_128_CBC_SHA DHE-DSS-AES128-SHA
  238. TLS_DHE_DSS_WITH_AES_256_CBC_SHA DHE-DSS-AES256-SHA
  239. TLS_DHE_RSA_WITH_AES_128_CBC_SHA DHE-RSA-AES128-SHA
  240. TLS_DHE_RSA_WITH_AES_256_CBC_SHA DHE-RSA-AES256-SHA
  241. TLS_DH_anon_WITH_AES_128_CBC_SHA ADH-AES128-SHA
  242. TLS_DH_anon_WITH_AES_256_CBC_SHA ADH-AES256-SHA
  243. =head2 Camellia ciphersuites from RFC4132, extending TLS v1.0
  244. TLS_RSA_WITH_CAMELLIA_128_CBC_SHA CAMELLIA128-SHA
  245. TLS_RSA_WITH_CAMELLIA_256_CBC_SHA CAMELLIA256-SHA
  246. TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA Not implemented.
  247. TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA Not implemented.
  248. TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA Not implemented.
  249. TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA Not implemented.
  250. TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA DHE-DSS-CAMELLIA128-SHA
  251. TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA DHE-DSS-CAMELLIA256-SHA
  252. TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA DHE-RSA-CAMELLIA128-SHA
  253. TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA DHE-RSA-CAMELLIA256-SHA
  254. TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA ADH-CAMELLIA128-SHA
  255. TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA ADH-CAMELLIA256-SHA
  256. =head2 SEED ciphersuites from RFC4162, extending TLS v1.0
  257. TLS_RSA_WITH_SEED_CBC_SHA SEED-SHA
  258. TLS_DH_DSS_WITH_SEED_CBC_SHA Not implemented.
  259. TLS_DH_RSA_WITH_SEED_CBC_SHA Not implemented.
  260. TLS_DHE_DSS_WITH_SEED_CBC_SHA DHE-DSS-SEED-SHA
  261. TLS_DHE_RSA_WITH_SEED_CBC_SHA DHE-RSA-SEED-SHA
  262. TLS_DH_anon_WITH_SEED_CBC_SHA ADH-SEED-SHA
  263. =head2 GOST ciphersuites from draft-chudov-cryptopro-cptls, extending TLS v1.0
  264. Note: these ciphers require an engine which including GOST cryptographic
  265. algorithms, such as the B<ccgost> engine, included in the OpenSSL distribution.
  266. TLS_GOSTR341094_WITH_28147_CNT_IMIT GOST94-GOST89-GOST89
  267. TLS_GOSTR341001_WITH_28147_CNT_IMIT GOST2001-GOST89-GOST89
  268. TLS_GOSTR341094_WITH_NULL_GOSTR3411 GOST94-NULL-GOST94
  269. TLS_GOSTR341001_WITH_NULL_GOSTR3411 GOST2001-NULL-GOST94
  270. =head2 Additional Export 1024 and other cipher suites
  271. Note: these ciphers can also be used in SSL v3.
  272. TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA EXP1024-DES-CBC-SHA
  273. TLS_RSA_EXPORT1024_WITH_RC4_56_SHA EXP1024-RC4-SHA
  274. TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA EXP1024-DHE-DSS-DES-CBC-SHA
  275. TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA EXP1024-DHE-DSS-RC4-SHA
  276. TLS_DHE_DSS_WITH_RC4_128_SHA DHE-DSS-RC4-SHA
  277. =head2 SSL v2.0 cipher suites.
  278. SSL_CK_RC4_128_WITH_MD5 RC4-MD5
  279. SSL_CK_RC4_128_EXPORT40_WITH_MD5 EXP-RC4-MD5
  280. SSL_CK_RC2_128_CBC_WITH_MD5 RC2-MD5
  281. SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 EXP-RC2-MD5
  282. SSL_CK_IDEA_128_CBC_WITH_MD5 IDEA-CBC-MD5
  283. SSL_CK_DES_64_CBC_WITH_MD5 DES-CBC-MD5
  284. SSL_CK_DES_192_EDE3_CBC_WITH_MD5 DES-CBC3-MD5
  285. =head1 NOTES
  286. The non-ephemeral DH modes are currently unimplemented in OpenSSL
  287. because there is no support for DH certificates.
  288. Some compiled versions of OpenSSL may not include all the ciphers
  289. listed here because some ciphers were excluded at compile time.
  290. =head1 EXAMPLES
  291. Verbose listing of all OpenSSL ciphers including NULL ciphers:
  292. openssl ciphers -v 'ALL:eNULL'
  293. Include all ciphers except NULL and anonymous DH then sort by
  294. strength:
  295. openssl ciphers -v 'ALL:!ADH:@STRENGTH'
  296. Include only 3DES ciphers and then place RSA ciphers last:
  297. openssl ciphers -v '3DES:+RSA'
  298. Include all RC4 ciphers but leave out those without authentication:
  299. openssl ciphers -v 'RC4:!COMPLEMENTOFDEFAULT'
  300. Include all chiphers with RSA authentication but leave out ciphers without
  301. encryption.
  302. openssl ciphers -v 'RSA:!COMPLEMENTOFALL'
  303. =head1 SEE ALSO
  304. L<s_client(1)|s_client(1)>, L<s_server(1)|s_server(1)>, L<ssl(3)|ssl(3)>
  305. =head1 HISTORY
  306. The B<COMPLENTOFALL> and B<COMPLEMENTOFDEFAULT> selection options
  307. for cipherlist strings were added in OpenSSL 0.9.7.
  308. The B<-V> option for the B<ciphers> command was added in OpenSSL 1.0.0.
  309. =cut