summaryrefslogtreecommitdiff
path: root/lib/Crypto/Cipher/ARC2.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Crypto/Cipher/ARC2.py')
-rw-r--r--lib/Crypto/Cipher/ARC2.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Crypto/Cipher/ARC2.py b/lib/Crypto/Cipher/ARC2.py
index 7393497..e9284a1 100644
--- a/lib/Crypto/Cipher/ARC2.py
+++ b/lib/Crypto/Cipher/ARC2.py
@@ -40,6 +40,16 @@ thoroughly as AES, which is also faster than RC2.
New designs should not use RC2.
+As an example, encryption can be done as follows:
+
+ >>> from Crypto.Cipher import ARC2
+ >>> from Crypto import Random
+ >>>
+ >>> key = b'Sixteen byte key'
+ >>> iv = Random.new().read(ARC2.block_size)
+ >>> cipher = ARC2.new(key, ARC2.MODE_CFB, iv)
+ >>> msg = iv + cipher.encrypt(b'Attack at dawn')
+
.. _RC2: http://en.wikipedia.org/wiki/RC2
.. _RFC2268: http://tools.ietf.org/html/rfc2268