A very simple wrapper for pbkdf2 encryption that follows NIST recommendations for constructing IVs (see NIST publication section 8.2). See godoc for information and tests for usage.
package main
import (
"fmt"
"github.com/schollz/encryption"
)
func main() {
s := []byte("hello, world")
p := "secret passphrase"
encrypted := encryption.Encrypt(s, p)
fmt.Println(encrypted)
// prints: agjZrMKjmY2LOnq3.jsOW25nDrq4=.UydSNRCWCwev1Pp53ThDZtUZkJoDuFBt81aZTA==
decrypted, err := encryption.Decrypt(encrypted, p)
fmt.Println(string(decrypted), err)
// Hello, world <nil>
}