Documentation ¶
Index ¶
- Variables
- func AesDecodeString(data string, pwd ...string) (string, error)
- func AesDecodeStringByTimestamp(data string, pwd ...string) (string, error)
- func AesDecrypt(crypted, key []byte) (retBuf []byte, retErr error)
- func AesDecryptByTimestamp(crypted, key []byte) (retBuf []byte, retErr error)
- func AesDecryptIV(data []byte, key, iv []byte, padding ...string) (retData []byte, retErr error)
- func AesECBDecrypt(data, key []byte, padding ...string) (retBuffer []byte, retErr error)
- func AesECBEncrypt(data, key []byte, padding ...string) ([]byte, error)
- func AesEncodeByKIV(data []byte, nonce string, key, iv []byte, hexOutput bool) ([]byte, error)
- func AesEncodeString(data string, mode string, pwd ...string) (string, error)
- func AesEncrypt(origData, key []byte) ([]byte, error)
- func AesEncryptIV(data []byte, key, iv []byte, padding ...string) ([]byte, error)
- func Base64Decode(src string) ([]byte, error)
- func Base64Encode(src []byte) string
- func Base64Encode2(src []byte) []byte
- func CompressZipFile(files []*os.File, compreFile *os.File) (err error)
- func DesDecrypt(crypted, key []byte, padding ...string) ([]byte, error)
- func DesECBDecrypt(crypted, key []byte, padding ...string) ([]byte, error)
- func DesECBEncrypt(origData, key []byte, padding ...string) ([]byte, error)
- func DesEncrypt(origData, key []byte, padding ...string) ([]byte, error)
- func Hex2Bytes(str string) ([]byte, error)
- func Md5(in string) string
- func Md516(in string) string
- func NewECBDecrypt(b cipher.Block) cipher.BlockMode
- func NewECBEncrypt(b cipher.Block) cipher.BlockMode
- func NewRSAKeyString(bits int) (priKey string, pubKey string, retErr error)
- func PKCS0Padding(ciphertext []byte, blockSize int) []byte
- func PKCS0UnPadding(origData []byte) []byte
- func PKCS5Padding(cipherText []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func PKCS7Padding(cipherText []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func RSASignature(plainText []byte, privateKeyStr string) ([]byte, error)
- func RSAVerify(plainText, sigText []byte, pubKeyStr string) (bool, error)
- func RsaDecode(privateKey string, text string) (string, error)
- func RsaEncode(publicKey string, msg string) (string, error)
- func SHA256(str string) string
- func SaveRsaPrivateKey(privateKey *rsa.PrivateKey) (string, error)
- func SaveRsaPublicKey(publicKey *rsa.PublicKey) (string, error)
- func TestRsa()
- func TrDesDecode(data []byte) ([]byte, error)
- func TrDesDecodeString(data string) (string, error)
- func TrDesEncode(data []byte) ([]byte, error)
- func TrDesEncodeString(data string, mode string) (string, error)
- func TripleDesDecrypt(crypted, key []byte, padding ...string) ([]byte, error)
- func TripleDesECBDecrypt(crypted, key []byte, padding ...string) ([]byte, error)
- func TripleDesECBEncrypt(origData, key []byte, padding ...string) ([]byte, error)
- func TripleDesEncrypt(origData, key []byte, padding ...string) ([]byte, error)
- func UnZipFile(srcFile *os.File, dest string, topFilename *string) ([]string, error)
- func Unzip(buffer *bytes.Buffer) string
- func UnzipByte(buffer *bytes.Buffer) ([]byte, error)
- func UnzipByte2(buffer []byte) ([]byte, error)
- func UnzipFileByPath(tarFile, dest string) (string, []string, error)
- func Zip(buffer []byte) []byte
- type KIVHeader
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidBlock = errors.New("invalid block")
View Source
var ErrInvalidChecksum = errors.New("invalid checksum")
View Source
var ErrInvalidTimestamp = errors.New("invalid timestamp")
Functions ¶
func AesDecrypt ¶
func AesDecryptByTimestamp ¶
func AesDecryptIV ¶
func AesECBDecrypt ¶
func AesEncodeByKIV ¶
func AesEncodeString ¶
func AesEncrypt ¶
func AesEncryptIV ¶
func Base64Decode ¶
func Base64Encode ¶
func Base64Encode2 ¶
func CompressZipFile ¶
CompressZipFile CompressZipFile
func DesECBDecrypt ¶
key必须是8个字节
func DesECBEncrypt ¶
key必须是8个字节
func PKCS0Padding ¶
func PKCS0UnPadding ¶
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func PKCS7Padding ¶
func PKCS7UnPadding ¶
func SaveRsaPrivateKey ¶
func SaveRsaPrivateKey(privateKey *rsa.PrivateKey) (string, error)
func TrDesDecode ¶
func TrDesDecodeString ¶
func TrDesEncode ¶
func TrDesEncodeString ¶
mode: hex, base64, default base64
func TripleDesDecrypt ¶
func TripleDesECBDecrypt ¶
func TripleDesECBEncrypt ¶
func TripleDesEncrypt ¶
func UnzipByte2 ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.