summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2024-11-09 22:03:49 +0000
committerschwarze <>2024-11-09 22:03:49 +0000
commit00b35208c83ec1d015bb83985f53e1e4cbbc0e70 (patch)
tree16b296573ca66b1f60e34fdb03b4b43963fcce0e /src/lib
parentd0c0ceacf41c5d7d278724824d2b6fb5730c2201 (diff)
downloadopenbsd-00b35208c83ec1d015bb83985f53e1e4cbbc0e70.tar.gz
openbsd-00b35208c83ec1d015bb83985f53e1e4cbbc0e70.tar.bz2
openbsd-00b35208c83ec1d015bb83985f53e1e4cbbc0e70.zip
Mention the key lengths of some encryption algorithms.
This is relevant because EVP_EncryptInit(3) takes a "key" argument, and users need to consider the size of that argument. While here, also mention whether ciphers are stream ciphers or block ciphers and what the block size is.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/EVP_EncryptInit.341
-rw-r--r--src/lib/libcrypto/man/EVP_aes_128_cbc.36
-rw-r--r--src/lib/libcrypto/man/EVP_camellia_128_cbc.38
-rw-r--r--src/lib/libcrypto/man/EVP_des_cbc.313
4 files changed, 47 insertions, 21 deletions
diff --git a/src/lib/libcrypto/man/EVP_EncryptInit.3 b/src/lib/libcrypto/man/EVP_EncryptInit.3
index a0adfbab09..32ed3349b9 100644
--- a/src/lib/libcrypto/man/EVP_EncryptInit.3
+++ b/src/lib/libcrypto/man/EVP_EncryptInit.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: EVP_EncryptInit.3,v 1.52 2024/07/21 08:36:43 tb Exp $ 1.\" $OpenBSD: EVP_EncryptInit.3,v 1.53 2024/11/09 22:03:49 schwarze Exp $
2.\" full merge up to: OpenSSL 5211e094 Nov 11 14:39:11 2014 -0800 2.\" full merge up to: OpenSSL 5211e094 Nov 11 14:39:11 2014 -0800
3.\" EVP_bf_cbc.pod EVP_cast5_cbc.pod EVP_idea_cbc.pod EVP_rc2_cbc.pod 3.\" EVP_bf_cbc.pod EVP_cast5_cbc.pod EVP_idea_cbc.pod EVP_rc2_cbc.pod
4.\" 7c6d372a Nov 20 13:20:01 2018 +0000 4.\" 7c6d372a Nov 20 13:20:01 2018 +0000
@@ -69,7 +69,7 @@
69.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 69.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
70.\" OF THE POSSIBILITY OF SUCH DAMAGE. 70.\" OF THE POSSIBILITY OF SUCH DAMAGE.
71.\" 71.\"
72.Dd $Mdocdate: July 21 2024 $ 72.Dd $Mdocdate: November 9 2024 $
73.Dt EVP_ENCRYPTINIT 3 73.Dt EVP_ENCRYPTINIT 3
74.Os 74.Os
75.Sh NAME 75.Sh NAME
@@ -553,7 +553,6 @@ returns an
553.Vt EVP_CIPHER 553.Vt EVP_CIPHER
554structure. 554structure.
555.Sh CIPHER LISTING 555.Sh CIPHER LISTING
556All algorithms have a fixed key length unless otherwise stated.
557.Bl -tag -width Ds 556.Bl -tag -width Ds
558.It Fn EVP_enc_null 557.It Fn EVP_enc_null
559Null cipher: does nothing. 558Null cipher: does nothing.
@@ -564,6 +563,8 @@ Null cipher: does nothing.
564.Fn EVP_idea_ofb 563.Fn EVP_idea_ofb
565.Xc 564.Xc
566IDEA encryption algorithm in CBC, ECB, CFB and OFB modes respectively. 565IDEA encryption algorithm in CBC, ECB, CFB and OFB modes respectively.
566IDEA is a block cipher operating on 64 bit blocks using a 128 bit
567.Fa key .
567.Fn EVP_idea_cfb 568.Fn EVP_idea_cfb
568is an alias for 569is an alias for
569.Fn EVP_idea_cfb64 , 570.Fn EVP_idea_cfb64 ,
@@ -575,7 +576,9 @@ implemented as a macro.
575.Fn EVP_rc2_ofb 576.Fn EVP_rc2_ofb
576.Xc 577.Xc
577RC2 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. 578RC2 encryption algorithm in CBC, ECB, CFB and OFB modes respectively.
578This is a variable key length cipher with an additional parameter called 579RC2 is a block cipher operating on 64 bit blocks using a variable
580.Fa key
581length with an additional parameter called
579"effective key bits" or "effective key length". 582"effective key bits" or "effective key length".
580By default both are set to 128 bits. 583By default both are set to 128 bits.
581.Fn EVP_rc2_cfb 584.Fn EVP_rc2_cfb
@@ -602,7 +605,10 @@ to set the key length and effective key length.
602.Xc 605.Xc
603Blowfish encryption algorithm in CBC, ECB, CFB and OFB modes 606Blowfish encryption algorithm in CBC, ECB, CFB and OFB modes
604respectively. 607respectively.
605This is a variable key length cipher. 608Blowfish is a block cipher operating on 64 bit blocks using a variable
609.Fa key
610length.
611The default key length is 128 bits.
606.Fn EVP_bf_cfb 612.Fn EVP_bf_cfb
607is an alias for 613is an alias for
608.Fn EVP_bf_cfb64 , 614.Fn EVP_bf_cfb64 ,
@@ -613,21 +619,28 @@ implemented as a macro.
613.Fn EVP_cast5_cfb64 , 619.Fn EVP_cast5_cfb64 ,
614.Fn EVP_cast5_ofb 620.Fn EVP_cast5_ofb
615.Xc 621.Xc
616CAST encryption algorithm in CBC, ECB, CFB and OFB modes respectively. 622CAST-128 encryption algorithm in CBC, ECB, CFB and OFB modes respectively.
617This is a variable key length cipher. 623CAST-128 is a block cipher operating on 64 bit blocks using a variable
624.Fa key
625length.
626The default and maximum key length is 128 bits.
618.Fn EVP_cast5_cfb 627.Fn EVP_cast5_cfb
619is an alias for 628is an alias for
620.Fn EVP_cast5_cfb64 , 629.Fn EVP_cast5_cfb64 ,
621implemented as a macro. 630implemented as a macro.
622.El 631.El
623.Pp 632.Pp
624See also 633Some algorithms are documented in separate manual pages:
625.Xr EVP_aes_128_cbc 3 , 634.Pp
626.Xr EVP_camellia_128_cbc 3 , 635.Bl -column "EVP_camellia_128_cbc(3)" "block size" -compact
627.Xr EVP_des_cbc 3 , 636.It manual page Ta block size Ta Fa key No size Pq in bits
628.Xr EVP_rc4 3 , 637.It Xr EVP_aes_128_cbc 3 Ta 128 Ta 128, 192, 256
629and 638.It Xr EVP_camellia_128_cbc 3 Ta 128 Ta 128, 192, 256
630.Xr EVP_sm4_cbc 3 . 639.It Xr EVP_chacha20 3 Ta stream Ta 256
640.It Xr EVP_des_cbc 3 Ta 64 Ta 64
641.It Xr EVP_rc4 3 Ta stream Ta variable, default 128
642.It Xr EVP_sm4_cbc 3 Ta 128 Ta 128
643.El
631.Ss GCM mode 644.Ss GCM mode
632For GCM mode ciphers, the behaviour of the EVP interface 645For GCM mode ciphers, the behaviour of the EVP interface
633is subtly altered and several additional ctrl operations are 646is subtly altered and several additional ctrl operations are
diff --git a/src/lib/libcrypto/man/EVP_aes_128_cbc.3 b/src/lib/libcrypto/man/EVP_aes_128_cbc.3
index 4d153e5cbd..6249bf7348 100644
--- a/src/lib/libcrypto/man/EVP_aes_128_cbc.3
+++ b/src/lib/libcrypto/man/EVP_aes_128_cbc.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: EVP_aes_128_cbc.3,v 1.5 2023/11/16 20:27:43 schwarze Exp $ 1.\" $OpenBSD: EVP_aes_128_cbc.3,v 1.6 2024/11/09 22:03:49 schwarze Exp $
2.\" selective merge up to: OpenSSL 7c6d372a Nov 20 13:20:01 2018 +0000 2.\" selective merge up to: OpenSSL 7c6d372a Nov 20 13:20:01 2018 +0000
3.\" 3.\"
4.\" This file was written by Ronald Tse <ronald.tse@ribose.com> 4.\" This file was written by Ronald Tse <ronald.tse@ribose.com>
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: November 16 2023 $ 51.Dd $Mdocdate: November 9 2024 $
52.Dt EVP_AES_128_CBC 3 52.Dt EVP_AES_128_CBC 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -170,6 +170,8 @@
170These functions provide the AES encryption algorithm in the 170These functions provide the AES encryption algorithm in the
171.Xr evp 3 171.Xr evp 3
172framework. 172framework.
173AES is a family of block ciphers operating on 128 bit blocks
174using key lengths of 128, 192, and 256 bits.
173.Pp 175.Pp
174.Fn EVP_aes_128_cbc , 176.Fn EVP_aes_128_cbc ,
175.Fn EVP_aes_192_cbc , 177.Fn EVP_aes_192_cbc ,
diff --git a/src/lib/libcrypto/man/EVP_camellia_128_cbc.3 b/src/lib/libcrypto/man/EVP_camellia_128_cbc.3
index 190247a68b..6f15a85f7f 100644
--- a/src/lib/libcrypto/man/EVP_camellia_128_cbc.3
+++ b/src/lib/libcrypto/man/EVP_camellia_128_cbc.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: EVP_camellia_128_cbc.3,v 1.2 2020/06/24 18:15:00 jmc Exp $ 1.\" $OpenBSD: EVP_camellia_128_cbc.3,v 1.3 2024/11/09 22:03:49 schwarze Exp $
2.\" selective merge up to: OpenSSL 7c6d372a Nov 20 13:20:01 2018 +0000 2.\" selective merge up to: OpenSSL 7c6d372a Nov 20 13:20:01 2018 +0000
3.\" 3.\"
4.\" This file was written by Ronald Tse <ronald.tse@ribose.com> 4.\" This file was written by Ronald Tse <ronald.tse@ribose.com>
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: June 24 2020 $ 51.Dd $Mdocdate: November 9 2024 $
52.Dt EVP_CAMELLIA_128_CBC 3 52.Dt EVP_CAMELLIA_128_CBC 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -122,7 +122,9 @@
122These functions provide the Camellia encryption algorithm in the 122These functions provide the Camellia encryption algorithm in the
123.Xr evp 3 123.Xr evp 3
124framework. 124framework.
125They use 128, 192, and 256-bit keys in the following modes, respectively: 125Camellia is a block cipher operating on 128 bit blocks.
126These functions use 128, 192, and 256-bit keys
127in the following modes, respectively:
126CBC, CFB with 1-bit shift, CFB with 8-bit shift, CFB with 128-bit shift, 128CBC, CFB with 1-bit shift, CFB with 8-bit shift, CFB with 128-bit shift,
127ECB, and OFB. 129ECB, and OFB.
128.Pp 130.Pp
diff --git a/src/lib/libcrypto/man/EVP_des_cbc.3 b/src/lib/libcrypto/man/EVP_des_cbc.3
index 759e03fac0..7c8a08c7db 100644
--- a/src/lib/libcrypto/man/EVP_des_cbc.3
+++ b/src/lib/libcrypto/man/EVP_des_cbc.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: EVP_des_cbc.3,v 1.1 2019/03/21 12:54:37 schwarze Exp $ 1.\" $OpenBSD: EVP_des_cbc.3,v 1.2 2024/11/09 22:03:49 schwarze Exp $
2.\" full merge up to: 2.\" full merge up to:
3.\" OpenSSL EVP_desx_cbc.pod 8fa4d95e Oct 21 11:59:09 2017 +0900 3.\" OpenSSL EVP_desx_cbc.pod 8fa4d95e Oct 21 11:59:09 2017 +0900
4.\" selective merge up to: 4.\" selective merge up to:
@@ -51,7 +51,7 @@
51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52.\" OF THE POSSIBILITY OF SUCH DAMAGE. 52.\" OF THE POSSIBILITY OF SUCH DAMAGE.
53.\" 53.\"
54.Dd $Mdocdate: March 21 2019 $ 54.Dd $Mdocdate: November 9 2024 $
55.Dt EVP_DES_CBC 3 55.Dt EVP_DES_CBC 3
56.Os 56.Os
57.Sh NAME 57.Sh NAME
@@ -128,6 +128,15 @@
128These functions provide the DES encryption algorithm in the 128These functions provide the DES encryption algorithm in the
129.Xr evp 3 129.Xr evp 3
130framework. 130framework.
131DES is a block cipher operating on 64 bit blocks.
132The key length to be used for
133.Xr EVP_EncryptInit 3
134is 64 bits.
135However, only 56 of these bits are used in the encryption algorithm.
136The least significant bit in each of the eight bytes is only used
137for checking parity.
138Using this algorithm is discouraged because the short key length
139makes it vulnerable to brute force attacks.
131.Pp 140.Pp
132.Fn EVP_des_cbc , 141.Fn EVP_des_cbc ,
133.Fn EVP_des_cfb1 , 142.Fn EVP_des_cfb1 ,