6 ms·
BTW, there's NaCl port to Go in the official go.crypto repository: http://go.pkgdoc.org/code.google.com/p/go.crypto/nacl/ http://go.pkgdoc.org/code.google.com/p
by dchest 14y ago
BTW, there's NaCl port to Go in the official go.crypto repository: http://go.pkgdoc.org/code.google.com/p/go.crypto/nacl/ http://go.pkgdoc.org/code.google.com/p/go.crypto/nacl/
If you use Go, instead of hacking together things with AES from the standard library to encrypt something, just `go get code.google.com/p/go.crypto/nacl/secretbox` and call secretbox.Seal with unique [randomly generated is okay] nonce and your key to get the encrypted and authenticated "box". secretbox.Open with the same key and nonce will open it.
Bonus: on amd64 it's extremely fast (portions are written in assembly, and even pure Go versions for other platforms are hand-optimized), faster than what you can get from any non-hardware AES implementation (let alone authenticated with HMAC), and provides better security margin.