Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 571 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 571 Bytes

pubkit

Secure encryption library, provides cryptographic APIs to encrypt and authenticate messages with public-key cryptography.

Usage example

Public-key authenticated encryption uses Curve25519 and Poly1305 to encrypt and authenticate messages, high-level example:

// generate public/private key pairs
aPub, _ := pubkit.GenerateKeys()
bPub, bPrv := pubkit.GenerateKeys()

// encrypt for both 'a' and 'b' with public keys
secret := pubkit.Seal("hello", aPub, bPub)

// decrypt for 'b' with private key
doc := pubkit.Open(secret, bPrv)
fmt.Println(doc)