Documentation ¶
Index ¶
- func AesDecrypt(cipherText, key []byte) ([]byte, error)
- func AesEncrypt(plainText, key []byte) ([]byte, error)
- func DesDecrypt(cipherText, key []byte) ([]byte, error)
- func DesEncrypt(plainText, key []byte) ([]byte, error)
- func GenerateRSAKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(cipherText []byte, blockSize int) ([]byte, error)
- func PrivateKeyToString(priv *rsa.PrivateKey) string
- func PublicKeyToString(pub *rsa.PublicKey) (string, error)
- func RSADecrypt(ciphertext []byte, privkey *rsa.PrivateKey) ([]byte, error)
- func RSAEncrypt(plaintext []byte, pubkey *rsa.PublicKey) ([]byte, error)
- func StringToPrivateKey(privStr string) (*rsa.PrivateKey, error)
- func StringToPublicKey(pubStr string) (*rsa.PublicKey, error)
- func TripleDesDecrypt(cipherText, key []byte) ([]byte, error)
- func TripleDesEncrypt(plainText, key []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRSAKeyPair ¶
func GenerateRSAKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, error)
func PKCS5UnPadding ¶
去除PKCS5填充
func PrivateKeyToString ¶
func PrivateKeyToString(priv *rsa.PrivateKey) string
func RSADecrypt ¶
func RSADecrypt(ciphertext []byte, privkey *rsa.PrivateKey) ([]byte, error)
func StringToPrivateKey ¶
func StringToPrivateKey(privStr string) (*rsa.PrivateKey, error)
func TripleDesDecrypt ¶
TripleDesDecrypt 3DES解密
func TripleDesEncrypt ¶
TripleDesEncrypt 3DES加密
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.