lazyxsalsa
End-to-End Encryption an wrapper for libsodium in golang.


Algorithm details
- Key exchange: X25519
- Encryption: XSalsa20
- Authentication: Poly1305
Install
go get github.com/prongbang/lazyxsalsa
Benchmark
BenchmarkEncrypt-10 35792 33285 ns/op
BenchmarkDecrypt-10 36526 32821 ns/op
How to use
keyPair := lazyxsalsa.NewKeyPair()
clientKp := lazyxsalsa.NewKeyPair()
serverKp := lazyxsalsa.NewKeyPair()
clientSharedKey := clientKp.Exchange(serverKp.Pk)
serverSharedKey := serverKp.Exchange(clientKp.Pk)
lazyXsalsa := lazyxsalsa.New()
plaintext := `Plaintext`
ciphertext, err := lazyXsalsa.Encrypt(plaintext, clientSharedKey)
lazyXsalsa := lazyxsalsa.New()
ciphertext := "ae76477791140129a083a09ff68d5b10460f125c9affdefff48d52d30d774a7c3f42f364ea581eb9b114a65cdbf535171a"
plaintext, err := lazyXsalsa.Decrypt(ciphertext, serverSharedKey)