crypto

package
v0.0.0-...-37c92c9 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package crypto includes objects for hashing and encryption

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AESEncrypt

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

AESEncrypt handles encryption/decryption for the AES cipher

func (*AESEncrypt) Decrypt

func (e *AESEncrypt) Decrypt(in []byte) ([]byte, error)

Decrypt decrypts the given byte slice with the AES cipher

func (*AESEncrypt) Encrypt

func (e *AESEncrypt) Encrypt(in []byte) ([]byte, error)

Encrypt encrypts the given byte slice with the AES cipher

func (*AESEncrypt) Key

func (e *AESEncrypt) Key() []byte

Key returns the currently set key as []bytes

type EncryptionHandler

type EncryptionHandler interface {
	Encrypt(in []byte) ([]byte, error)
	Decrypt(in []byte) ([]byte, error)
	Key() []byte
}

EncryptionHandler is an interface for encryption/decryption objects

func NewEncryptionHandler

func NewEncryptionHandler(key, encType string, hashHandler HashHandler) EncryptionHandler

NewEncryptionHandler creates a struct for handler encryption/decryption

type HashHandler

type HashHandler interface {
	Process(input string) (string, error)
}

HashHandler implements a hashing processor interface

func NewHashHandler

func NewHashHandler(algorithm string) HashHandler

NewHashHandler creates a new instance of a HashHandler object

type HashProcess

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

HashProcess is an object for performing hash functions on strings

func (*HashProcess) Process

func (hs *HashProcess) Process(input string) (string, error)

Process performs the configured hash function on the given input string

Jump to

Keyboard shortcuts

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