Documentation
¶
Index ¶
- func AesDecryptCBC(encrypted []byte, key []byte) (decrypted []byte)
- func AesDecryptCFB(encrypted []byte, key []byte) (decrypted []byte)
- func AesDecryptECB(encrypted []byte, key []byte) (decrypted []byte)
- func AesEncryptCBC(origData []byte, key []byte) (encrypted []byte)
- func AesEncryptCFB(origData []byte, key []byte) (encrypted []byte)
- func AesEncryptECB(origData []byte, key []byte) (encrypted []byte)
- func GetMd5String(s string) string
- func PKCS7Padding(ciphertext []byte, blocksize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func RSA_Decrypt(src []byte, privateKey *rsa.PrivateKey) ([]byte, error)
- func RSA_DecryptByPem(src []byte, file string) ([]byte, error)
- func RSA_Encrypt(src []byte, publickey *rsa.PublicKey) ([]byte, error)
- func RSA_GenKeys(bits int) (privateKey *rsa.PrivateKey, publicKey *rsa.PublicKey, err error)
- func RSA_GenPemFiles(dir string, bits int) error
- func RSA_GenPems(privateKeyWriter, publicKeyWriter io.Writer, bits int) error
- func RSA_JSEncrypt(msg string, privateData []byte) string
- func RSA_JSEncryptByPem(msg string, privatePemPath string) string
- func RSA_PrivateKeyFromBytes(priByte []byte) (*rsa.PrivateKey, error)
- func RSA_PrivateKeyFromFile(file string) (*rsa.PrivateKey, error)
- func RSA_PublicKeyFromBytes(pubByte []byte) (*rsa.PublicKey, error)
- func RSA_PublicKeyFromFile(file string) (*rsa.PublicKey, error)
- func Sha1(data string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecryptCBC ¶
func AesDecryptCFB ¶
func AesDecryptECB ¶
func AesEncryptCBC ¶
=================== CBC ====================== AesEncryptCBC aes-密码分组链接模式
func AesEncryptCFB ¶
=================== CFB ======================
func AesEncryptECB ¶
=================== ECB ====================== AesEncryptECB 电码本模式
func GetMd5String ¶
func PKCS7Padding ¶
补码 AES加密数据块分组长度必须为128bit(byte[16]),密钥长度可以是128bit(byte[16])、192bit(byte[24])、256bit(byte[32])中的任意一个。
func RSA_DecryptByPem ¶
RSA_DecryptByPem 通过Pem文件解码
func RSA_GenKeys ¶
func RSA_GenPems ¶
RSA_GenPems 产生公钥私钥对应的pem文件
func RSA_JSEncrypt ¶
RSA_JSEncrypt 用于用户名、密码解密
func RSA_JSEncryptByPem ¶ added in v1.1.1
RSA_JSEncrypt 用于用户名、密码解密
func RSA_PrivateKeyFromBytes ¶
func RSA_PrivateKeyFromBytes(priByte []byte) (*rsa.PrivateKey, error)
解析私匙
func RSA_PrivateKeyFromFile ¶
func RSA_PrivateKeyFromFile(file string) (*rsa.PrivateKey, error)
解析私匙
func RSA_PublicKeyFromBytes ¶
解析公匙
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.