Documentation ¶
Index ¶
- func DecodeString(key string) ([]byte, error)
- func Decrypt(pubKey *rsa.PrivateKey, message []byte) ([]byte, error)
- func EncodeToString(data []byte) string
- func Encrypt(pubKey *rsa.PublicKey, message []byte) ([]byte, error)
- func FnvHash(s string) (uint32, error)
- func GenerateSecretKey() (*rsa.PrivateKey, error)
- func Md5Encrypt(data []byte) string
- func Sha1(key string) []byte
- func Sha256(key string) []byte
- type AesEncrypt
- type BaseEncrypt
- type IEncrypt
- type Linear
- type Rsa2
- type XteaEncrypt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeString ¶
func EncodeToString ¶
func GenerateSecretKey ¶
func GenerateSecretKey() (*rsa.PrivateKey, error)
func Md5Encrypt ¶
Types ¶
type AesEncrypt ¶
type AesEncrypt struct {
SecretKey string
}
func NewAesEncrypt ¶
func NewAesEncrypt(key string) *AesEncrypt
func (*AesEncrypt) PKCS7Padding ¶
func (a *AesEncrypt) PKCS7Padding(ciphertext []byte, blockSize int) []byte
PKCS7Padding 补码
func (*AesEncrypt) PKCS7UnPadding ¶
func (a *AesEncrypt) PKCS7UnPadding(origData []byte) []byte
PKCS7UnPadding 去码
type BaseEncrypt ¶
type BaseEncrypt struct{}
type Linear ¶
type XteaEncrypt ¶
type XteaEncrypt struct {
SecretKey string
}
func NewXteaEncrypt ¶
func NewXteaEncrypt(key string) *XteaEncrypt
Click to show internal directories.
Click to hide internal directories.