lib

package
v0.0.0-...-5d0e957 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorToRGB

func ColorToRGB(color string) (r, g, b int, err error)

ColorToRGB

func HexToColor

func HexToColor(val []byte) []string

HexToColor

Types

type AESEncryptorImpl

type AESEncryptorImpl struct{}

AESEncryptorImpl

func (*AESEncryptorImpl) CBC

func (*AESEncryptorImpl) CBC(key, val []byte) ([]byte, error)

CBC aes encrypt cipher block chaining the key length must be 16,24,32

func (*AESEncryptorImpl) CFB

func (*AESEncryptorImpl) CFB(key, val []byte) ([]byte, error)

CFB aes encrypt cipher feedback

func (*AESEncryptorImpl) CRT

func (*AESEncryptorImpl) CRT(key []byte, val []byte) ([]byte, error)

CRT aes encrypt or decrypt counter

func (*AESEncryptorImpl) DCBC

func (*AESEncryptorImpl) DCBC(key, val []byte) ([]byte, error)

DCBC aes decrypt cipher block chaining the key length must be 16,24,32

func (*AESEncryptorImpl) DCFB

func (*AESEncryptorImpl) DCFB(key, val []byte) ([]byte, error)

DCFB aes decrypt cipher feedback

func (*AESEncryptorImpl) DECB

func (*AESEncryptorImpl) DECB(key, val []byte) ([]byte, error)

DECB aes decrypt electronic codebook book

func (*AESEncryptorImpl) DOFB

func (*AESEncryptorImpl) DOFB(key, val []byte) ([]byte, error)

DOFB aes decrypt output FeedBack

func (*AESEncryptorImpl) ECB

func (*AESEncryptorImpl) ECB(key, val []byte) ([]byte, error)

ECB aes encrypt electronic codebook book

func (*AESEncryptorImpl) ECBGenerateKey

func (*AESEncryptorImpl) ECBGenerateKey(key []byte) []byte

ECBGenerateKey aes electronic codebook book generte key

func (*AESEncryptorImpl) OFB

func (*AESEncryptorImpl) OFB(key, val []byte) ([]byte, error)

OFB aes encrypt output FeedBack

type AESEncryptorInterface

type AESEncryptorInterface interface {
	ECB(key, val []byte) ([]byte, error)  // aes encrypt electronic codebook book (ECB)
	DECB(key, val []byte) ([]byte, error) // aes decrypt electronic codebook book (ECB)
	ECBGenerateKey(key []byte) []byte     // aes electronic codebook book generte key

	CBC(key, val []byte) ([]byte, error)  // aes encrypt cipher block chaining (CBC)
	DCBC(key, val []byte) ([]byte, error) // aes decrypt cipher block chaining (DCBC)

	CRT(key, val []byte) ([]byte, error) // aes encrypt or decrypt counter (CTR)

	CFB(key, val []byte) ([]byte, error)  // aes encrypt cipher feedback (CFB)
	DCFB(key, val []byte) ([]byte, error) // aes decrypt cipher feedback (CFB)

	OFB(key, val []byte) ([]byte, error)  // aes encrypt output FeedBack (OFB)
	DOFB(key, val []byte) ([]byte, error) // aes decrypt output FeedBack (OFB)

}

AESEncryptorInterface

var AESEncryptor AESEncryptorInterface = (*AESEncryptorImpl)(nil)

AESEncryptor

type DESEncryptorImpl

type DESEncryptorImpl struct{}

DESEncryptorImpl

func (*DESEncryptorImpl) CBC

func (*DESEncryptorImpl) CBC(key, val []byte) ([]byte, error)

CBC des encrypt cipher block chaining (CBC)

func (*DESEncryptorImpl) CFB

func (*DESEncryptorImpl) CFB(key, val []byte) ([]byte, error)

CFB des encrypt cipher feedback

func (*DESEncryptorImpl) CRT

func (*DESEncryptorImpl) CRT(key []byte, val []byte) ([]byte, error)

CRT des encrypt or decrypt counter

func (*DESEncryptorImpl) DCBC

func (*DESEncryptorImpl) DCBC(key, val []byte) ([]byte, error)

DCBC des decrypt cipher block chaining (DCBC)

func (*DESEncryptorImpl) DCFB

func (*DESEncryptorImpl) DCFB(key, val []byte) ([]byte, error)

DCFB des decrypt cipher feedback

func (*DESEncryptorImpl) DECB

func (*DESEncryptorImpl) DECB(key, val []byte) ([]byte, error)

DECB des decrypt electronic codebook book

func (*DESEncryptorImpl) DOFB

func (*DESEncryptorImpl) DOFB(key, val []byte) ([]byte, error)

DOFB des decrypt output FeedBack

func (*DESEncryptorImpl) ECB

func (*DESEncryptorImpl) ECB(key, val []byte) ([]byte, error)

ECB des encrypt electronic codebook book

func (*DESEncryptorImpl) OFB

func (*DESEncryptorImpl) OFB(key, val []byte) ([]byte, error)

OFB des encrypt output FeedBack

type DESEncryptorInterface

type DESEncryptorInterface interface {
	ECB(key, val []byte) ([]byte, error)  // des encrypt electronic codebook book (ECB)
	DECB(key, val []byte) ([]byte, error) // des decrypt electronic codebook book (ECB)

	CBC(key, val []byte) ([]byte, error)  // des encrypt cipher block chaining (CBC)
	DCBC(key, val []byte) ([]byte, error) // des decrypt cipher block chaining (DCBC)

	CRT(key, val []byte) ([]byte, error) // des encrypt or decrypt counter (CTR)

	CFB(key, val []byte) ([]byte, error)  // des encrypt cipher feedback (CFB)
	DCFB(key, val []byte) ([]byte, error) // des decrypt cipher feedback (CFB)

	OFB(key, val []byte) ([]byte, error)  // des encrypt output FeedBack (OFB)
	DOFB(key, val []byte) ([]byte, error) // des decrypt output FeedBack (OFB)
}

DESEncryptorInterface

var DESEncryptor DESEncryptorInterface = (*DESEncryptorImpl)(nil)

DESEncryptor

type EncryptorImpl

type EncryptorImpl struct{}

EncryptorImpl

func (*EncryptorImpl) CRC32

func (*EncryptorImpl) CRC32(val string) uint32

CRC32

func (*EncryptorImpl) Hmac

func (*EncryptorImpl) Hmac(key, val string) string

Hmac

func (*EncryptorImpl) HmacSha256

func (*EncryptorImpl) HmacSha256(key, val string) string

HmacSha256

func (*EncryptorImpl) MD5

func (*EncryptorImpl) MD5(val string) string

MD5

func (*EncryptorImpl) Sha1

func (*EncryptorImpl) Sha1(val string) string

Sha1

func (*EncryptorImpl) Sha256

func (*EncryptorImpl) Sha256(val string) string

Sha256

func (*EncryptorImpl) Sha512

func (*EncryptorImpl) Sha512(val string) string

Sha512

type EncryptorInterface

type EncryptorInterface interface {
	MD5(val string) string    // val to md5
	Sha1(val string) string   // val to sha1
	Sha256(val string) string // val to sha256
	Sha512(val string) string // val to sha512

	CRC32(val string) uint32 // val to crc32

	Hmac(key, val string) string       // val to hmac
	HmacSha256(key, val string) string // val to hmac sha256
}

EncryptorInterface

var Encryptor EncryptorInterface = (*EncryptorImpl)(nil)

Encryptor

type PKCSImpl

type PKCSImpl struct{}

func (*PKCSImpl) Padding

func (*PKCSImpl) Padding(val []byte, blockSize int) []byte

PKCS Padding pkcs padding

func (*PKCSImpl) UnPadding

func (*PKCSImpl) UnPadding(val []byte) []byte

PKCS UnPadding pkcs unpadding

type PKCSInterface

type PKCSInterface interface {
	Padding(val []byte, blockSize int) []byte // pkcs padding
	UnPadding(val []byte) []byte              // pkcs unpadding
}
var PKCS PKCSInterface = (*PKCSImpl)(nil)

Jump to

Keyboard shortcuts

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