Documentation ¶
Index ¶
- func ColorToRGB(color string) (r, g, b int, err error)
- func HexToColor(val []byte) []string
- type AESEncryptorImpl
- func (*AESEncryptorImpl) CBC(key, val []byte) ([]byte, error)
- func (*AESEncryptorImpl) CFB(key, val []byte) ([]byte, error)
- func (*AESEncryptorImpl) CRT(key []byte, val []byte) ([]byte, error)
- func (*AESEncryptorImpl) DCBC(key, val []byte) ([]byte, error)
- func (*AESEncryptorImpl) DCFB(key, val []byte) ([]byte, error)
- func (*AESEncryptorImpl) DECB(key, val []byte) ([]byte, error)
- func (*AESEncryptorImpl) DOFB(key, val []byte) ([]byte, error)
- func (*AESEncryptorImpl) ECB(key, val []byte) ([]byte, error)
- func (*AESEncryptorImpl) ECBGenerateKey(key []byte) []byte
- func (*AESEncryptorImpl) OFB(key, val []byte) ([]byte, error)
- type AESEncryptorInterface
- type DESEncryptorImpl
- func (*DESEncryptorImpl) CBC(key, val []byte) ([]byte, error)
- func (*DESEncryptorImpl) CFB(key, val []byte) ([]byte, error)
- func (*DESEncryptorImpl) CRT(key []byte, val []byte) ([]byte, error)
- func (*DESEncryptorImpl) DCBC(key, val []byte) ([]byte, error)
- func (*DESEncryptorImpl) DCFB(key, val []byte) ([]byte, error)
- func (*DESEncryptorImpl) DECB(key, val []byte) ([]byte, error)
- func (*DESEncryptorImpl) DOFB(key, val []byte) ([]byte, error)
- func (*DESEncryptorImpl) ECB(key, val []byte) ([]byte, error)
- func (*DESEncryptorImpl) OFB(key, val []byte) ([]byte, error)
- type DESEncryptorInterface
- type EncryptorImpl
- func (*EncryptorImpl) CRC32(val string) uint32
- func (*EncryptorImpl) Hmac(key, val string) string
- func (*EncryptorImpl) HmacSha256(key, val string) string
- func (*EncryptorImpl) MD5(val string) string
- func (*EncryptorImpl) Sha1(val string) string
- func (*EncryptorImpl) Sha256(val string) string
- func (*EncryptorImpl) Sha512(val string) string
- type EncryptorInterface
- type PKCSImpl
- type PKCSInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
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
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) HmacSha256 ¶
func (*EncryptorImpl) HmacSha256(key, val string) string
HmacSha256
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 PKCSInterface ¶
type PKCSInterface interface { Padding(val []byte, blockSize int) []byte // pkcs padding UnPadding(val []byte) []byte // pkcs unpadding }
var PKCS PKCSInterface = (*PKCSImpl)(nil)