crypto

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: GPL-3.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveKey

func DeriveKey(password, salt []byte) ([]byte, error)

DeriveKey derives a password using scrypt

func MustDeriveKey

func MustDeriveKey(password, salt []byte) []byte

MustDeriveKey calls DeriveKey panicking on error

Types

type Cipher

type Cipher struct {
	// contains filtered or unexported fields
}

Cipher performs cipher operations using AES

func New

func New(salt, key []byte) *Cipher

New returns a ne crypto object

func (*Cipher) Decrypt

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

Decrypt decrypts previously encrypted data

func (*Cipher) Encrypt

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

Encrypt encrypts data

Jump to

Keyboard shortcuts

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