summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/EVP_rc2_cbc.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/EVP_rc2_cbc.3')
-rw-r--r--src/lib/libcrypto/man/EVP_rc2_cbc.3201
1 files changed, 0 insertions, 201 deletions
diff --git a/src/lib/libcrypto/man/EVP_rc2_cbc.3 b/src/lib/libcrypto/man/EVP_rc2_cbc.3
deleted file mode 100644
index 38c8184260..0000000000
--- a/src/lib/libcrypto/man/EVP_rc2_cbc.3
+++ /dev/null
@@ -1,201 +0,0 @@
1.\" $OpenBSD: EVP_rc2_cbc.3,v 1.1 2024/12/08 17:41:23 schwarze Exp $
2.\"
3.\" Copyright (c) 2024 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: December 8 2024 $
18.Dt EVP_RC2_CBC 3
19.Os
20.Sh NAME
21.Nm EVP_rc2_cbc ,
22.Nm EVP_rc2_ecb ,
23.Nm EVP_rc2_cfb64 ,
24.Nm EVP_rc2_cfb ,
25.Nm EVP_rc2_ofb ,
26.Nm EVP_rc2_40_cbc ,
27.Nm EVP_rc2_64_cbc
28.Nd Rivest Cipher 2 in the EVP framework
29.Sh SYNOPSIS
30.In openssl/evp.h
31.Ft const EVP_CIPHER *
32.Fn EVP_rc2_cbc void
33.Ft const EVP_CIPHER *
34.Fn EVP_rc2_ecb void
35.Ft const EVP_CIPHER *
36.Fn EVP_rc2_cfb64 void
37.Ft const EVP_CIPHER *
38.Fn EVP_rc2_cfb void
39.Ft const EVP_CIPHER *
40.Fn EVP_rc2_ofb void
41.Ft const EVP_CIPHER *
42.Fn EVP_rc2_40_cbc void
43.Ft const EVP_CIPHER *
44.Fn EVP_rc2_64_cbc void
45.In openssl/rc2.h
46.Fd #define RC2_BLOCK 8
47.Fd #define RC2_KEY_LENGTH 16
48.Sh DESCRIPTION
49RC2 is a block cipher operating on blocks of
50.Dv RC2_BLOCK No = 8
51bytes, equivalent to 64 bits, using a variable
52.Fa key
53length with an additional parameter called
54.Dq effective key bits
55or
56.Dq effective key length .
57.Pp
58.Fn EVP_rc2_cbc ,
59.Fn EVP_rc2_ecb ,
60.Fn EVP_rc2_cfb64 ,
61and
62.Fn EVP_rc2_ofb
63provide the RC2 encryption algorithm in CBC, ECB, CFB and OFB mode,
64respectively.
65.Fn EVP_rc2_cfb
66is an alias for
67.Fn EVP_rc2_cfb64 ,
68implemented as a macro.
69.Pp
70By default, these functions set both the key length
71and the effective key length to
72.Dv RC2_KEY_LENGTH No = 16
73bytes, which is not a very useful value because it is quite short.
74.Pp
75Configuring normally requires a multi-step process:
76.Bl -enum -width 2n
77.It
78Create a new, empty
79.Vt EVP_CIPHER_CTX
80object with
81.Xr EVP_CIPHER_CTX_new 3 .
82.It
83Select the operation mode by calling
84.Xr EVP_EncryptInit 3
85with the desired
86.Fa type
87argument, passing
88.Dv NULL
89pointers for the
90.Fa key
91and
92.Fa iv
93arguments.
94.It
95Select the
96.Fa key
97length by passing the desired number of bytes to
98.Xr EVP_CIPHER_CTX_set_key_length 3 .
99Doing so overrides the default key length of
100.Dv RC2_KEY_LENGTH No = 16 .
101Valid values for
102.Fa keylen
103are positive and less than or equal to 128.
104.It
105Select the effective key length by calling
106.Xr EVP_CIPHER_CTX_ctrl 3
107with a
108.Fa type
109argument of
110.Dv EVP_CTRL_SET_RC2_KEY_BITS ,
111passing the desired number of bits in
112.Fa arg .
113Doing so overrides the default effective key length of 128 bits.
114Valid values for
115.Fa arg
116are positive and less than or equal to 1024.
117The
118.Fa ptr
119argument is ignored; passing
120.Dv NULL
121is recommended.
122.It
123Call
124.Xr EVP_EncryptInit 3
125a second time, this time passing
126.Dv NULL
127for the type argument.
128The
129.Fa key
130argument points to an array containing the number of bytes that was passed to
131.Xr EVP_CIPHER_CTX_set_key_length 3 ,
132and the
133.Fa iv
134argument points to an array of eight bytes.
135.It
136Finally,
137.Xr EVP_EncryptUpdate 3
138and
139.Xr EVP_EncryptFinal 3
140can be used in the normal way.
141.El
142.Pp
143Once a
144.Fa ctx
145object is fully configured, calling
146.Xr EVP_CIPHER_CTX_ctrl 3
147with a
148.Fa type
149argument of
150.Dv EVP_CTRL_GET_RC2_KEY_BITS
151interprets
152.Fa ptr
153as a pointer to
154.Vt int
155and stores the effective key length in bits at that location.
156In this case,
157.Fa arg
158is ignored and passing 0 is recommended.
159.Pp
160In the CFB and OFB modes, the minimum required total length in bytes
161of the output buffer is equal to the total number of input bytes to
162be encoded.
163In the CBC and ECB modes, the minimum required total length
164of the output buffer has to be rounded up to the next multiple
165of the block size of eight bytes.
166.Pp
167.Fn EVP_rc2_40_cbc
168and
169.Fn EVP_rc2_64_cbc
170are obsolete functions that provide the RC2 algorithm in CBC mode
171with a key length and an effective key length of 40 and 64 bits,
172respectively.
173.Sh RETURN VALUES
174With the
175.Vt EVP_CIPHER
176objects documented in the present manual page,
177.Fn EVP_CIPHER_CTX_ctrl
178returns 1 for success or 0 if an error occurs.
179.Sh SEE ALSO
180.Xr evp 3 ,
181.Xr EVP_CIPHER_CTX_set_key_length 3 ,
182.Xr EVP_EncryptInit 3 ,
183.Xr RC2_encrypt 3
184.Sh HISTORY
185.Fn EVP_rc2_cbc ,
186.Fn EVP_rc2_ecb ,
187.Fn EVP_rc2_cfb ,
188and
189.Fn EVP_rc2_ofb
190first appeared in SSLeay 0.5.2 and have been available since
191.Ox 2.4 .
192.Pp
193.Fn EVP_rc2_40_cbc
194and
195.Fn EVP_rc2_64_cbc
196first appeared in SSLeay 0.9.1 and have been available since
197.Ox 2.6 .
198.Pp
199.Fn EVP_rc2_cfb64
200first appeared in OpenSSL 0.9.7e and has been available since
201.Ox 3.8 .