From 292112bc875016fd08198fe72091ab32f48f515b Mon Sep 17 00:00:00 2001 From: Donald Stufft Date: Sun, 11 Aug 2013 14:32:17 -0400 Subject: Make the example error free Without padding b"my secret message" is not divisible by AES's block size and thus would throw an error. --- docs/primitives/symmetric-encryption.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/primitives/symmetric-encryption.rst b/docs/primitives/symmetric-encryption.rst index 0812f6b9..9986d89d 100644 --- a/docs/primitives/symmetric-encryption.rst +++ b/docs/primitives/symmetric-encryption.rst @@ -14,7 +14,7 @@ where the encrypter and decrypter both use the same key. >>> from cryptography.primitives.block import BlockCipher, ciphers, modes >>> cipher = BlockCipher(ciphers.AES(key), modes.CBC(iv)) - >>> cipher.encrypt("my secret message") + cipher.finalize() + >>> cipher.encrypt(b"a secret message") + cipher.finalize() # The ciphertext [...] -- cgit v1.2.3