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 11 The following functions have been deprecated since OpenSSL 3.0, and can be 12 hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value, 13 see L<openssl_user_macros(7)>: 14 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 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 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 54 Applications should use the higher level functions 55 L<EVP_EncryptInit(3)> etc. instead of calling these 56 functions directly. 57 58 It is difficult to securely use stream ciphers. For example, do not perform 59 multiple encryptions using the same key stream. 60 61 =head1 SEE ALSO 62 63 L<EVP_EncryptInit(3)> 64 65 =head1 HISTORY 66 67 All of these functions were deprecated in OpenSSL 3.0. 68 69 =head1 COPYRIGHT 70 71 Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved. 72 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>. 77 78 =cut 79