From e5917781674c3678589571621c9b18153d2140b5 Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Sat, 3 Jan 2015 21:58:25 -0800 Subject: IV should be 16 bytes --- docs/hazmat/primitives/symmetric-encryption.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/hazmat') diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst index 24854b1c..d532ad1b 100644 --- a/docs/hazmat/primitives/symmetric-encryption.rst +++ b/docs/hazmat/primitives/symmetric-encryption.rst @@ -34,7 +34,7 @@ in an "encrypt-then-MAC" formulation as `described by Colin Percival`_. >>> from cryptography.hazmat.backends import default_backend >>> backend = default_backend() >>> key = os.urandom(32) - >>> iv = os.urandom(32) + >>> iv = os.urandom(16) >>> cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=backend) >>> encryptor = cipher.encryptor() >>> ct = encryptor.update(b"a secret message") + encryptor.finalize() -- cgit v1.2.3