Go module providing encryption and decryption of byte-level data.
go-ecodec
is a standard Go module which can be installed with:
go get github.com/wealdtech/go-ecodec
package main
import (
"fmt"
ecodec "github.com/wealdtech/go-ecodec"
)
func main() {
data := []byte("The data to be encrypted")
key := []byte("my secret passphrase")
encryptedData, err := ecodec.Encrypt(data, key)
if err != nil {
panic(err)
}
decryptedData, err := ecodec.Decrypt(encryptedData, key)
if err != nil {
panic(err)
}
fmt.Printf("Decrypted data is %q\n", string(decryptedData))
}
Jim McDonald: @mcdee.
Contributions welcome. Please check out the issues.
Apache-2.0 © 2019 Weald Technology Trading Ltd