tool

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SALT = 12

Variables

This section is empty.

Functions

func RandomByte

func RandomByte(len int) []byte

func RegisterLoogers

func RegisterLoogers(p RegisterLogger)

Types

type BCryptService

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

func Bcrypt

func Bcrypt(password []byte) *BCryptService

func (*BCryptService) Compare

func (y *BCryptService) Compare(hash []byte) (err error)

func (*BCryptService) Hash

func (y *BCryptService) Hash() (pass string, err error)

type Cipher

type Cipher struct {
	Key []byte
}

func CipherTool

func CipherTool(key []byte) *Cipher

func (*Cipher) Decrypt

func (y *Cipher) Decrypt(ciphertext, iv []byte) ([]byte, error)

func (*Cipher) Encrypt

func (y *Cipher) Encrypt(plaintext, iv []byte) ([]byte, error)

type MachineProtocol

type MachineProtocol struct {
	Valid   bool
	Key     []byte
	Iv      []byte
	Message []byte
}

func MachineProtocolEncrypted

func MachineProtocolEncrypted(enc []byte) *MachineProtocol

func (*MachineProtocol) GetIv

func (y *MachineProtocol) GetIv() []byte

func (*MachineProtocol) GetKey

func (y *MachineProtocol) GetKey() []byte

func (*MachineProtocol) GetMessage

func (y *MachineProtocol) GetMessage() []byte

func (*MachineProtocol) IsValidProtocol

func (y *MachineProtocol) IsValidProtocol() bool

func (*MachineProtocol) ToBase64

func (y *MachineProtocol) ToBase64() string

func (*MachineProtocol) ToByteArray

func (y *MachineProtocol) ToByteArray() []byte

type RegisterLogger

type RegisterLogger struct {
	Typ         loggers.LoggerType
	UserId      int
	Description string
}

Jump to

Keyboard shortcuts

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