nacl

package
v0.0.0-...-811459a Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2017 License: ISC Imports: 5 Imported by: 0

Documentation

Overview

Package nacl provides encryption by salting a key with a pad

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(pad, key, data []byte) (out []byte, err error)

Decrypt salts a key using pad and decrypts a message

func Encrypt

func Encrypt(pad, key, message []byte) (out []byte, err error)

Encrypt salts a key using pad and encrypts a message

func RandomPadEncrypt

func RandomPadEncrypt(key, message []byte) (pad, out []byte, err error)

RandomPadEncrypt generates a random pad and returns the encrypted data, the pad, and an error if any

Types

type Cipher

type Cipher struct {
	Pad []byte
}

Cipher to implmement the BlockCipher interface

func (*Cipher) Decrypt

func (c *Cipher) Decrypt(key, ciphertext []byte) ([]byte, error)

Decrypt implements the BlockCipher interface

func (*Cipher) Encrypt

func (c *Cipher) Encrypt(key, plaintext []byte) ([]byte, error)

Encrypt implements the BlockCipher interface

func (*Cipher) KeySize

func (c *Cipher) KeySize() int

KeySize returns the NaCL keysize

Jump to

Keyboard shortcuts

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