miscreant / meta

Meta-repository for Miscreant: misuse-resistant symmetric encryption library with AES-SIV (RFC 5297) and AES-PMAC-SIV support
https://miscreant.io
Other
474 stars 27 forks source link

[Python] Incorrect documentation example for AES SIV open #192

Open synchronization opened 6 years ago

synchronization commented 6 years ago

In the following wiki document: https://github.com/miscreant/miscreant/wiki/Python-Documentation

The last piece of example code should be like this:

import os
from miscreant.aes.siv import SIV

key = SIV.generate_key()
siv = SIV(key)

message = "Hello, world!"
nonce = os.urandom(16)

ciphertext = siv.seal(message, [nonce])
plaintext = siv.open(ciphertext, [nonce])

(only the last line is different as we should open ciphertext and not message)