Documentation
¶
Index ¶
- func AesDecryptCBC(encrypted, key []byte) (decrypted []byte, err error)
- func AesDecryptCFB(encrypted, key []byte) (decrypted []byte, err error)
- func AesDecryptECB(encrypted, key []byte) (decrypted []byte, err error)
- func AesEncryptCBC(data, key []byte) (encrypted []byte, err error)
- func AesEncryptCFB(data, key []byte) (encrypted []byte, err error)
- func AesEncryptECB(data, key []byte) (encrypted []byte, err error)
- func EncodePrivateRSAKeyToPEM(privateKey *rsa.PrivateKey) []byte
- func EncodePublicRSAKeyToPEM(publicKey *rsa.PublicKey) ([]byte, error)
- func GenerateRSAKey(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func Gzip(data []byte) []byte
- func IsNil(v interface{}) bool
- func Md5(v any) string
- func Md5String(v string) string
- func NewPwd(uid string, pwd string) string
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func RSADecrypt(src, piv []byte) ([]byte, error)
- func RSAEncrypt(src, pub []byte) ([]byte, error)
- func Sha256(v any) string
- func Sha256Stream(r io.Reader) string
- func UnGzip(data []byte) ([]byte, error)
- func VerifyPwd(uid string, cptPwd, pwd string) bool
- type Buffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecryptCBC ¶
func AesDecryptCFB ¶
func AesDecryptECB ¶
func AesEncryptCBC ¶
func AesEncryptCFB ¶
func AesEncryptECB ¶
func EncodePrivateRSAKeyToPEM ¶
func EncodePrivateRSAKeyToPEM(privateKey *rsa.PrivateKey) []byte
EncodePrivateRSAKeyToPEM @Description: 将私钥转换为PEM格式 @param privateKey @return []byte
func EncodePublicRSAKeyToPEM ¶
EncodePublicRSAKeyToPEM @Description: 将公钥转换为PEM格式 @param publicKey @return []byte @return error
func GenerateRSAKey ¶
GenerateRSAKey @Description: 生成RSA密钥对 @param bits @return *rsa.PrivateKey @return *rsa.PublicKey @return error
func NewPwd ¶
NewPwd @Description: 用uid+pwd对密码加工,使密码数据每次不一样且不可逆 @param uid @param pwd @return string
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func RSADecrypt ¶
RSADecrypt @Description: RSA解密 @param src @param filename @return []byte @return error
func RSAEncrypt ¶
RSAEncrypt @Description: RSA加密 @param src @param filename @return []byte @return error
func Sha256Stream ¶ added in v0.0.4
Types ¶
Click to show internal directories.
Click to hide internal directories.