5 RC4_set_key, RC4 - RC4 encryption
9 #include <openssl/rc4.h>
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)>:
15 void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
17 void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata,
18 unsigned char *outdata);
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.
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.
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.
34 RC4 consists of a key setup phase and the actual encryption or
37 RC4_set_key() sets up the B<RC4_KEY> B<key> using the B<len> bytes long
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.
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
50 RC4_set_key() and RC4() do not return values.
54 Applications should use the higher level functions
55 L<EVP_EncryptInit(3)> etc. instead of calling these
58 It is difficult to securely use stream ciphers. For example, do not perform
59 multiple encryptions using the same key stream.
67 All of these functions were deprecated in OpenSSL 3.0.
71 Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
73 Licensed under the Apache License 2.0 (the "License"). You may not use
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>.