Skip to content
Snippets Groups Projects
Commit f99b1e51 authored by Donald Stufft's avatar Donald Stufft
Browse files

Use nacl.secret.SecretBox.NONCE_SIZE instead of a hardcoded 24

parent 763eecb6
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,7 @@ Example ...@@ -31,7 +31,7 @@ Example
# This is a nonce, it *MUST* only be used once, but it is not considered # This is a nonce, it *MUST* only be used once, but it is not considered
# secret and can be transmitted or stored alongside the ciphertext. A # secret and can be transmitted or stored alongside the ciphertext. A
# good source of nonce is just 24 random bytes. # good source of nonce is just 24 random bytes.
nonce = nacl.random(24) nonce = nacl.random(nacl.secret.SecretBox.NONCE_SIZE)
# Encrypt our message, it will be exactly 16 bytes longer than the original # Encrypt our message, it will be exactly 16 bytes longer than the original
# message as it stores authentication information alongside it. # message as it stores authentication information alongside it.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment