RC4_set_key.pod 2.3 KB

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