From 4da28c35d93e14a5e6b0a252751e7cfbaf0fe372 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 7 Nov 2013 07:50:17 +0800 Subject: ARC4 support --- docs/hazmat/primitives/symmetric-encryption.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/hazmat/primitives/symmetric-encryption.rst') diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst index 7d3b072d..4d0703bb 100644 --- a/docs/hazmat/primitives/symmetric-encryption.rst +++ b/docs/hazmat/primitives/symmetric-encryption.rst @@ -149,6 +149,16 @@ 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. + Modes ~~~~~ -- cgit v1.2.3 From 0994c5628a3d960a45f8aac33f0d5d985eb48cf7 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sun, 10 Nov 2013 03:19:14 +0800 Subject: update docs to include arc4 example --- docs/hazmat/primitives/symmetric-encryption.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'docs/hazmat/primitives/symmetric-encryption.rst') diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst index 9d18ce50..77e61b56 100644 --- a/docs/hazmat/primitives/symmetric-encryption.rst +++ b/docs/hazmat/primitives/symmetric-encryption.rst @@ -159,6 +159,17 @@ Weak Ciphers ``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: -- cgit v1.2.3