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