Documentation ¶
Overview ¶
Package secretbox provides utility wrapper of https://godoc.org/golang.org/x/crypto/nacl/secretbox
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encrypt ¶
Example ¶
const key = "0f5297b6f0114171e9de547801b1e8bb929fe1d091e63c6377a392ec1baa3d0b" s, err := NewFromHexKey(key) if err != nil { panic(err) } plaintext := "vim vim vim" // Encrypt ciphertext, _ := s.Encrypt([]byte(plaintext)) // Decrypt b, err := s.Decrypt(ciphertext) if err != nil { panic(err) } fmt.Printf("%s", b)
Output: vim vim vim
Types ¶
type SecretBox ¶
type SecretBox struct {
// contains filtered or unexported fields
}
func NewFromHexKey ¶
Click to show internal directories.
Click to hide internal directories.