cipher

package
v0.0.0-...-69312e8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(ciphertext, key []byte) ([]byte, error)

func AesEncrypt

func AesEncrypt(plantText, key []byte) ([]byte, error)

func Base64Decode

func Base64Decode(str string) []byte

func Base64Encode

func Base64Encode(plainText []byte) string

func DesDecrypt

func DesDecrypt(crypted, key []byte) ([]byte, error)

Des Decryption Algorithm, key required (length:8)

func DesEncrypt

func DesEncrypt(origData, key []byte) ([]byte, error)

Des Encryption Algorithm, key required (length:8)

func GenerateRsaKey

func GenerateRsaKey(bits int) *rsa.PrivateKey

func GobDecode

func GobDecode(data []byte, to interface{}) error

func GobEncode

func GobEncode(data interface{}) ([]byte, error)

-------------------------------------------- encode --------------------------------------------

func HexDecode

func HexDecode(s string) []byte

func HexEncode

func HexEncode(s []byte) string

func JsonDecode

func JsonDecode(data []byte, v interface{}) error

func JsonEncode

func JsonEncode(v interface{}) []byte

func MarshalRsaKey

func MarshalRsaKey(priv *rsa.PrivateKey) (derPublic, derPrivate []byte, err error)

func Md5

func Md5(data []byte) []byte

func ParseRsaPriv

func ParseRsaPriv(mpriv []byte) *rsa.PrivateKey

func ParseRsaPub

func ParseRsaPub(mpub []byte) *rsa.PublicKey

func RsaDecrypt

func RsaDecrypt(priv *rsa.PrivateKey, ciphertext []byte) ([]byte, error)

func RsaEncrypt

func RsaEncrypt(pub *rsa.PublicKey, plaintext []byte) ([]byte, error)

func Sha256

func Sha256(plaintext []byte) []byte

func Sha512

func Sha512(plainText []byte) []byte

func Signature

func Signature(priv *rsa.PrivateKey, msg []byte) ([]byte, error)

func TripleDesDecrypt

func TripleDesDecrypt(crypted, key []byte) ([]byte, error)

3Des Encryption Algorithm, key required (length:24)

func TripleDesEncrypt

func TripleDesEncrypt(origData, key []byte) ([]byte, error)

3Des Encryption Algorithm, key required (length:24)

func VerifySign

func VerifySign(pub *rsa.PublicKey, sig []byte, msg []byte) error

func ZeroPadding

func ZeroPadding(ciphertext []byte, blockSize int) []byte

func ZeroUnPadding

func ZeroUnPadding(origData []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL