nacl.utils
A bytes
subclass that holds a message that has been encrypted by a ~nacl.secret.SecretBox
or ~nacl.public.Box
. The full content of the bytes
object is the combined nonce
and ciphertext
.
nonce
The nonce used during the encryption of the EncryptedMessage
.
ciphertext
The ciphertext contained within the EncryptedMessage
.
random(size=32)
Returns a random bytestring with the given size
.
- param bytes size
The size of the random bytestring.
- return bytes
The random bytestring.
randombytes_deterministic(size, seed, encoder=encoding.RawEncoder)
Returns size
number of deterministically generated pseudorandom bytes from a 32 byte seed.
- param bytes size
The size of the random bytestring.
- param bytes seed
The seed for the bytestring. This should be 32 bytes or a TypeError will be thrown.
- param encoder
The encoder class used to encode the produced bytes.
- return bytes
The random bytestring.