]>
Commit | Line | Data |
---|---|---|
c236e66d UM |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
5 | RC4_set_key, RC4 - RC4 encryption | |
6 | ||
7 | =head1 SYNOPSIS | |
8 | ||
9 | #include <openssl/rc4.h> | |
10 | ||
62c3fed0 P |
11 | Deprecated since OpenSSL 3.0, can be hidden entirely by defining |
12 | B<OPENSSL_API_COMPAT> with a suitable version value, see | |
13 | L<openssl_user_macros(7)>: | |
14 | ||
c236e66d UM |
15 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); |
16 | ||
17 | void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata, | |
18 | unsigned char *outdata); | |
19 | ||
20 | =head1 DESCRIPTION | |
21 | ||
62c3fed0 P |
22 | All of the functions described on this page are deprecated. Applications should |
23 | instead use L<EVP_EncryptInit_ex(3)>, L<EVP_EncryptUpdate(3)> and | |
24 | L<EVP_EncryptFinal_ex(3)> or the equivalently named decrypt functions. | |
25 | ||
c236e66d UM |
26 | This library implements the Alleged RC4 cipher, which is described for |
27 | example in I<Applied Cryptography>. It is believed to be compatible | |
28 | with RC4[TM], a proprietary cipher of RSA Security Inc. | |
29 | ||
30 | RC4 is a stream cipher with variable key length. Typically, 128 bit | |
31 | (16 byte) keys are used for strong encryption, but shorter insecure | |
32 | key sizes have been widely used due to export restrictions. | |
33 | ||
34 | RC4 consists of a key setup phase and the actual encryption or | |
35 | decryption phase. | |
36 | ||
37 | RC4_set_key() sets up the B<RC4_KEY> B<key> using the B<len> bytes long | |
38 | key at B<data>. | |
39 | ||
40 | RC4() encrypts or decrypts the B<len> bytes of data at B<indata> using | |
41 | B<key> and places the result at B<outdata>. Repeated RC4() calls with | |
42 | the same B<key> yield a continuous key stream. | |
43 | ||
44 | Since RC4 is a stream cipher (the input is XORed with a pseudo-random | |
45 | key stream to produce the output), decryption uses the same function | |
46 | calls as encryption. | |
47 | ||
48 | =head1 RETURN VALUES | |
49 | ||
50 | RC4_set_key() and RC4() do not return values. | |
51 | ||
52 | =head1 NOTE | |
53 | ||
c7497f34 | 54 | Applications should use the higher level functions |
9b86974e | 55 | L<EVP_EncryptInit(3)> etc. instead of calling these |
c7497f34 | 56 | functions directly. |
c236e66d | 57 | |
c7497f34 RS |
58 | It is difficult to securely use stream ciphers. For example, do not perform |
59 | multiple encryptions using the same key stream. | |
c236e66d | 60 | |
c7497f34 RS |
61 | =head1 SEE ALSO |
62 | ||
9b86974e | 63 | L<EVP_EncryptInit(3)> |
c7497f34 | 64 | |
62c3fed0 P |
65 | =head1 HISTORY |
66 | ||
67 | All of these functions were deprecated in OpenSSL 3.0. | |
68 | ||
e2f92610 RS |
69 | =head1 COPYRIGHT |
70 | ||
33388b44 | 71 | Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. |
e2f92610 | 72 | |
4746f25a | 73 | Licensed under the Apache License 2.0 (the "License"). You may not use |
e2f92610 RS |
74 | this file except in compliance with the License. You can obtain a copy |
75 | in the file LICENSE in the source distribution or at | |
76 | L<https://www.openssl.org/source/license.html>. | |
77 | ||
78 | =cut |