Fix CBC mode encryption example in classic.rst

Fix the result of the CBC mode encryption example by base64 encoding iv and ciphertext only once.
This commit is contained in:
William Breathitt Gray 2024-11-11 00:53:34 +09:00 committed by GitHub
parent dc92e70ffb
commit 20a98cb231
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -115,7 +115,7 @@ Example (encryption)::
>>> ct = b64encode(ct_bytes).decode('utf-8')
>>> result = json.dumps({'iv':iv, 'ciphertext':ct})
>>> print(result)
'{"iv": "bWRHdzkzVDFJbWNBY0EwSmQ1UXFuQT09", "ciphertext": "VDdxQVo3TFFCbXIzcGpYa1lJbFFZQT09"}'
'{"iv": "mdGw93T1ImcAcA0Jd5QqnA==", "ciphertext": "T7qAZ7LQBmr3pjXkYIlQYA=="}'
Example (decryption)::