Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

go-filecrypt

Streaming file encryption based on nacl/secretbox

Usage:

Encrypt file

key := filecrypt.Key([]byte("some super secret key"))

file, _ := os.Open("main.go")
defer file.Close()

encrypted, _ := os.Create("main.vau")
defer file.Close()
filecrypt.Encrypt(encrypted, file, &key)

encrypted.Seek(0, 0)

buf := bytes.NewBuffer(nil)
filecrypt.Decrypt(buf, encrypted, &key)

fmt.Printf("%v", string(buf.Bytes()))

** Encrypt message **

key := filecrypt.Key([]byte("some super secret key"))

emsg, ee := filecrypt.EncryptMessage([]byte("a message", &key, nil)

msg, ed := filecrypt.DecryptMessage(emsg, &key)

fmt.Printf(string(msg))

About

Streaming file encryption based on nacl/secretbox

Resources

Releases

No releases published

Packages

No packages published

Languages