I am new to Go and I am trying out the crypto package.
My code looks like:
package main
import "fmt"
import . "crypto/aes"
func main() {
block, _ := NewCipher([]byte("randomkey"))
var dst = []byte{}
var src = []byte("senstive")
block.Encrypt(dst, src)
fmt.Println(string(src))
}
I get the following error:
panic: runtime error: invalid memory address or nil pointer dereference.
What am I doing wrong?
My code can be found at the Go playground here