Secret key in Aead and/or SecretBox
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.2k
- Forks
- 267
- Avg merge
- 42m
- Merged PRs (30d)
- 2
Description
I would like to use pynacl in a project in which I want to encrypt a url.
I would like to provide back the key of the encryption but I see that it cannot be decoded back with utf-8.
import nacl.secret
import nacl.utils
key = nacl.utils.random(nacl.secret.Aead.KEY_SIZE)
box = nacl.secret.Aead(key)
key.decode('utf-8')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 1: invalid start byte
How is it possible to decode the key in a "readable" format that can be copy pasted easily?
Maybe my approach is not correct and I should be using something different?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the nacl.secret.Aead and SecretBox APIs and the nacl.utils.random entry point mentioned in the report. Clarify the documented handling of generated keys and identify the appropriate user-facing guidance for copying or storing them; done means the usage question is answered unambiguously in the relevant documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cryptography
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100