← Back to context

Comment by vngzs

1 year ago

You will still need to get the nonce and key generation right, but I'd recommend using Golang's nacl/secretbox [0] for a project such as this. It's designed to be relatively misuse-resistant compared to using underlying primitives directly, and under the hood it's XSalsa20+Poly1305 - so you can use random nonces with negligible collision risk.

[0]: https://pkg.go.dev/golang.org/x/crypto/nacl/secretbox