aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives/symmetric-encryption.rst
diff options
context:
space:
mode:
authorDavid Reid <dreid@dreid.org>2013-11-09 15:53:33 -0800
committerDavid Reid <dreid@dreid.org>2013-11-09 15:53:33 -0800
commit1aefe584a2c5c4f6bbf2839184868b16bdb9dc0b (patch)
tree2dd352daf4326db4856819b85487ca751b811632 /docs/hazmat/primitives/symmetric-encryption.rst
parentdf52fa9d388c2fc7d721c0fba5ca21ec88a01a15 (diff)
parent0994c5628a3d960a45f8aac33f0d5d985eb48cf7 (diff)
downloadcryptography-1aefe584a2c5c4f6bbf2839184868b16bdb9dc0b.tar.gz
cryptography-1aefe584a2c5c4f6bbf2839184868b16bdb9dc0b.tar.bz2
cryptography-1aefe584a2c5c4f6bbf2839184868b16bdb9dc0b.zip
Merge pull request #214 from reaperhulk/arc4-support
ARC4 Support
Diffstat (limited to 'docs/hazmat/primitives/symmetric-encryption.rst')
-rw-r--r--docs/hazmat/primitives/symmetric-encryption.rst21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst
index 5542e832..28b143ba 100644
--- a/docs/hazmat/primitives/symmetric-encryption.rst
+++ b/docs/hazmat/primitives/symmetric-encryption.rst
@@ -157,6 +157,27 @@ Weak Ciphers
:param bytes key: The secret key, 32-448 bits in length (in increments of
8). This must be kept secret.
+.. class:: ARC4(key)
+
+ ARC4 (Alleged RC4) is a stream cipher with serious weaknesses in its
+ initial stream output. Its use is strongly discouraged. ARC4 does not use
+ mode constructions.
+
+ :param bytes key: The secret key, ``40``, ``56``, ``64``, ``80``, ``128``,
+ ``192``, or ``256`` bits in length. This must be kept
+ secret.
+
+ .. doctest::
+
+ >>> from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
+ >>> algorithm = algorithms.ARC4(key)
+ >>> cipher = Cipher(algorithm, mode=None)
+ >>> encryptor = cipher.encryptor()
+ >>> ct = encryptor.update(b"a secret message")
+ >>> decryptor = cipher.decryptor()
+ >>> decryptor.update(ct)
+ 'a secret message'
+
.. _symmetric-encryption-modes: