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