pepper

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

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

Go to latest
Published: Jun 26, 2015 License: MIT Imports: 10 Imported by: 0

README

pepper

Because black boxes suck

TODO

  • local daemon & GUI
  • public directory
  • storage (centralized)
  • transfert & storage (P2P)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoxOpen

func BoxOpen(out, b []byte, nonce *[24]byte, peersPublicKey, privateKey *[32]byte) ([]byte, bool)

BoxOpen authenticates and decrypts a box produced by Seal and appends the message to out, which must not overlap box. The output will be Overhead bytes smaller than box.

func BoxSeal

func BoxSeal(out, message []byte, nonce *[24]byte, peersPublicKey, privateKey *[32]byte) []byte

BoxSeal appends an encrypted and authenticated copy of message to out, which will be Overhead bytes longer than the original and must not overlap. The nonce must be unique for each distinct message for a given pair of keys.

func Decrypt

func Decrypt(data *[]byte, pubKey, privKey *Key) ([]byte, error)

func DecryptFile

func DecryptFile(in, out string, pubKey, privKey *Key) error

func DecryptMsg

func DecryptMsg(message string, pubKey, privKey *Key) ([]byte, error)

DecryptMsg

func Encrypt

func Encrypt(data *[]byte, pubKey, privKey *Key) ([]byte, error)

Encrypt return encrypted data

func EncryptFile

func EncryptFile(in, out string, pubKey, privKey *Key) error

EncryptFile encrypt in to out

func EncryptMsg

func EncryptMsg(message []byte, pubKey, privKey *Key) (string, error)

EncryptMsg encrypt a message

func GenerateKey

func GenerateKey(rand io.Reader) (publicKey, privateKey *[32]byte, err error)

GenerateKey generates a new public/private key pair suitable for use with Seal and Open.

func GetHomeDir

func GetHomeDir() (string, error)

GetHomeDir returns the home dir of the current user as user.Current is not implemented on darwin/amd64 we must find a workaround...

Types

type Key

type Key struct {
	Raw  [32]byte
	Type string
}

Key represent a key

func KeyFromHomeDir

func KeyFromHomeDir(puborpriv string) (key *Key, err error)

GetUserKeyFromHomeDir returns public or private key of current user loade from his home dir

func KeyFromString

func KeyFromString(kstr string) (*Key, error)

KeyFromString return key struct from string

func (*Key) SaveInHomeDir

func (k *Key) SaveInHomeDir() error

SaveInHomeDir save key in home dir

func (*Key) String

func (k *Key) String() string

String return key as base64 encoded string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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