Skip to content

schollz/encryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

encryption

travis go report card coverage godocs

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.

Example

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>
}

About

A very simple wrapper for pbkdf2 encryption that follows NIST recommendations for constructing IVs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages