Documentation ¶
Index ¶
- func AesDecrypt(ciphertext, key []byte) ([]byte, error)
- func AesEncrypt(plantText, key []byte) ([]byte, error)
- func Base64Decode(str string) []byte
- func Base64Encode(plainText []byte) string
- func DesDecrypt(crypted, key []byte) ([]byte, error)
- func DesEncrypt(origData, key []byte) ([]byte, error)
- func GenerateRsaKey(bits int) *rsa.PrivateKey
- func GobDecode(data []byte, to interface{}) error
- func GobEncode(data interface{}) ([]byte, error)
- func HexDecode(s string) []byte
- func HexEncode(s []byte) string
- func JsonDecode(data []byte, v interface{}) error
- func JsonEncode(v interface{}) []byte
- func MarshalRsaKey(priv *rsa.PrivateKey) (derPublic, derPrivate []byte, err error)
- func Md5(data []byte) []byte
- func ParseRsaPriv(mpriv []byte) *rsa.PrivateKey
- func ParseRsaPub(mpub []byte) *rsa.PublicKey
- func RsaDecrypt(priv *rsa.PrivateKey, ciphertext []byte) ([]byte, error)
- func RsaEncrypt(pub *rsa.PublicKey, plaintext []byte) ([]byte, error)
- func Sha256(plaintext []byte) []byte
- func Sha512(plainText []byte) []byte
- func Signature(priv *rsa.PrivateKey, msg []byte) ([]byte, error)
- func TripleDesDecrypt(crypted, key []byte) ([]byte, error)
- func TripleDesEncrypt(origData, key []byte) ([]byte, error)
- func VerifySign(pub *rsa.PublicKey, sig []byte, msg []byte) error
- func ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
func AesEncrypt ¶
func Base64Decode ¶
func Base64Encode ¶
func DesDecrypt ¶
Des Decryption Algorithm, key required (length:8)
func DesEncrypt ¶
Des Encryption Algorithm, key required (length:8)
func GenerateRsaKey ¶
func GenerateRsaKey(bits int) *rsa.PrivateKey
func GobEncode ¶
-------------------------------------------- encode --------------------------------------------
func JsonDecode ¶
func JsonEncode ¶
func JsonEncode(v interface{}) []byte
func MarshalRsaKey ¶
func MarshalRsaKey(priv *rsa.PrivateKey) (derPublic, derPrivate []byte, err error)
func ParseRsaPriv ¶
func ParseRsaPriv(mpriv []byte) *rsa.PrivateKey
func ParseRsaPub ¶
func RsaDecrypt ¶
func RsaDecrypt(priv *rsa.PrivateKey, ciphertext []byte) ([]byte, error)
func TripleDesDecrypt ¶
3Des Encryption Algorithm, key required (length:24)
func TripleDesEncrypt ¶
3Des Encryption Algorithm, key required (length:24)
func ZeroPadding ¶
func ZeroUnPadding ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.