ezcrypt

package module
v0.0.0-...-e4e523e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2016 License: MIT Imports: 7 Imported by: 0

README

Ezcrypt GoDoc License Build Status Coverage Status

Ezcrypt is intended to make it easy to work with nacl/box in a safe and secure way.

It provides higher level abstractions than nacl/box and makes it easy to do cool cryptographic things.

It is currently a work in progress.

Documentation

Overview

Abstractions around nacl primitives

Index

Constants

View Source
const (
	KeySize = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key interface {
	Bytes() *[KeySize]byte
	Slice() []byte
	Encrypt(data []byte, in io.Reader) ([]byte, error)
	Decrypt(data []byte) ([]byte, error)
	Store(file string) error
}

Abstracts the bytes of a public or private key and knows how to do Symetric encryption operations

func GenerateKey

func GenerateKey(rand io.Reader) (Key, error)

Generates a new key

func LoadKey

func LoadKey(file string) (Key, error)

func NewKey

func NewKey(data []byte) (Key, error)

Constructs a new key from a slice of bytes.

type Pair

type Pair interface {
	Public() Key
	Encrypt(data []byte, dest Key, in io.Reader) ([]byte, error)
	Decrypt(data []byte, source Key) ([]byte, error)
	Store(public, private string) error
	// contains filtered or unexported methods
}

Abstracts a public private key pair.

func GeneratePair

func GeneratePair(rand io.Reader) (Pair, error)

Constructs a new key pair.

func LoadPair

func LoadPair(public, private string) (Pair, error)

Loads a keypair from two files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL