Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthOpen ¶
func AuthOpen(bytesBox []byte, otherPK *AnonymPublicKey, mySK *AnonymPrivateKey) ([]byte, bool)
AuthOpen is the authenticated version of AnonymBoxer.Open
func AuthSeal ¶
func AuthSeal(message []byte, otherPK *AnonymPublicKey, mySK *AnonymPrivateKey) ([]byte, error)
AuthSeal is the authenticated version of AnonymBoxer.Seal
Types ¶
type AnonymBoxer ¶
type AnonymBoxer struct { PublicKey AnonymPublicKey PrivateKey AnonymPrivateKey }
AnonymBoxer is a helper type for handling nacl boxes
type AnonymPrivateKey ¶
type AnonymPrivateKey struct {
Value [32]byte
}
AnonymPrivateKey is the private key part of an anonym boxer
type AnonymPublicKey ¶
type AnonymPublicKey struct {
Value [32]byte
}
AnonymPublicKey is the public key part of an anonym boxer
type FileBoxer ¶
type FileBoxer struct {
Key [32]byte `json:"key"`
}
FileBoxer is a stream cipher for encrypting huge files
type SymmetricKey ¶
SymmetricKey is a helper struct for handling nacl.secretbox
func DecodeSymmetricKey ¶
func DecodeSymmetricKey(data []byte) (*SymmetricKey, error)
DecodeSymmetricKey decodes and returns an encoded SymmetricKey
func (*SymmetricKey) BoxOpen ¶
func (k *SymmetricKey) BoxOpen(bytesBox []byte) ([]byte, bool)
BoxOpen decrypts the provided cipher text
func (*SymmetricKey) BoxSeal ¶
func (k *SymmetricKey) BoxSeal(message []byte) []byte
BoxSeal encrypts the provided message
func (*SymmetricKey) Encode ¶
func (k *SymmetricKey) Encode() ([]byte, error)
Encode encodes the secret key
Click to show internal directories.
Click to hide internal directories.