Documentation ¶
Index ¶
- func GenerateKey(opt AlgorithmType, key []byte) (crypto.SymmetricKey, error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) ([]byte, error)
- func TripleDesDec(key, src []byte) ([]byte, error)
- func TripleDesEnc(key, src []byte) ([]byte, error)
- type AESKey
- type AlgorithmType
- type ThirdDESKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
func GenerateKey(opt AlgorithmType, key []byte) (crypto.SymmetricKey, error)
func PKCS5Padding ¶
PKCS5Padding padding with pkcs5
func PKCS5UnPadding ¶
PKCS5UnPadding unpadding with pkcs5
func TripleDesDec ¶
TripleDesDec decryption algorithm implements
func TripleDesEnc ¶
TripleDesEnc encryption algorithm implements
Types ¶
type AESKey ¶
type AESKey struct {
// contains filtered or unexported fields
}
AES a AES instance is a tool to encrypt and decrypt
type AlgorithmType ¶
type AlgorithmType int32
HashType represent hash algorithm type
const ( AES AlgorithmType = iota ThirdDES )
type ThirdDESKey ¶
type ThirdDESKey struct {
// contains filtered or unexported fields
}
TripleDES a 3DES instance is a tool to encrypt and decrypt Very not recommended to use 3des!!! It's slow and unsafe
func (*ThirdDESKey) Bytes ¶
func (ea *ThirdDESKey) Bytes() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.