]> Cypherpunks repositories - gostls13.git/commit
crypto/cipher: use raw bytes for keys in docs
authorKevin Burke <kev@inburke.com>
Fri, 14 Jul 2017 22:20:27 +0000 (16:20 -0600)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 16 Nov 2017 00:40:00 +0000 (00:40 +0000)
commitc8691f3ac1bb7c175aa066b78d3c895afe1981f9
tree075aebdd7064671fc2e26ae61c96c52b06093469
parentc32626a4ce9293979c407c4e6a799d1bec37aa18
crypto/cipher: use raw bytes for keys in docs

Using ASCII values for keys is a bad idea since it makes them vastly
easier to guess. Instead, use the same method as the examples in the
golang.org/x/crypto/nacl package to load keys from a hex value.

Changing the key required updating the ciphertext in many of the
examples.

I am still worried about the fact the examples ask the user to
authenticate messages; authentication isn't trivial, and to be honest
it may be better to steer people to a higher level primitive like
secretbox, unless people really need AES.

Fixes #21012.

Change-Id: I8d918cf194694cd380b06c2d561178167ca61adb
Reviewed-on: https://go-review.googlesource.com/48596
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/crypto/cipher/example_test.go