crypto

package
v0.0.0-...-b7d53eb Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encryptor

type Encryptor interface {
	Encrypt(nonce, plaintext string) (ciphertext string, err error)
	Decrypt(nonce, ciphertext string) (plaintext string, err error)
}

Encryptor is the encryption interface

func MustNewEncryptor

func MustNewEncryptor() Encryptor

MustNewEncryptor creates a new encryptor or panic

type Hasher

type Hasher interface {
	Hash(data, salt string) string
	HashFaster(data, salt string) string
}

Hasher is an interface

func MustNewHasher

func MustNewHasher() Hasher

MustNewHasher creates a new Hasher

type Keccak256Hasher

type Keccak256Hasher struct{}

Keccak256Hasher is a Hasher, it was proven to be secure and used in Ethereum

func (*Keccak256Hasher) Hash

func (k *Keccak256Hasher) Hash(data, salt string) string

Hash ...

func (*Keccak256Hasher) HashFaster

func (k *Keccak256Hasher) HashFaster(data, salt string) string

HashFaster ...

type ScryptHasher

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

ScryptHasher is a Hasher that implements the Scrypt hashing algorithm

func (*ScryptHasher) Hash

func (sh *ScryptHasher) Hash(data, salt string) string

Hash ...

func (*ScryptHasher) HashFaster

func (sh *ScryptHasher) HashFaster(data, salt string) string

HashFaster ...

type SecretboxEncryptor

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

SecretboxEncryptor is the secretbox encryptor

func (*SecretboxEncryptor) Decrypt

func (se *SecretboxEncryptor) Decrypt(nonce, ciphertext string) (plaintext string, err error)

Decrypt ...

func (*SecretboxEncryptor) Encrypt

func (se *SecretboxEncryptor) Encrypt(nonce, plaintext string) (ciphertext string, err error)

Encrypt ...

Jump to

Keyboard shortcuts

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