encrypt

package
v0.0.0-...-dddd691 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Base64Table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

Variables

Functions

func AesCBCDecode

func AesCBCDecode(bs, key, iv []byte) (res []byte, e error)

func AesCBCEncode

func AesCBCEncode(content, key, iv []byte) (res []byte, e error)

func AesDecode

func AesDecode(s string, key string) (result string)

func AesDecodeBs2Bs

func AesDecodeBs2Bs(originBytes []byte, keyBytes []byte) (resultBytes []byte)

func AesDecodeBs2BsWithIV

func AesDecodeBs2BsWithIV(originBytes, keyBytes, ivBytes []byte) (resultBytes []byte)

func AesDecodeForBytes

func AesDecodeForBytes(s string, keyBytes []byte) (resultBytes []byte)

func AesEncode

func AesEncode(s string, key string) (result string)

func AesEncodeBs2Bs

func AesEncodeBs2Bs(content []byte, key []byte) (result []byte)

func AesEncodeBs2BsWithIV

func AesEncodeBs2BsWithIV(content, key, iv []byte) (result []byte)

func Base64Decode

func Base64Decode(s string) ([]byte, error)

func DecodeToBytes

func DecodeToBytes(s string) []byte

func EncodeToString

func EncodeToString(s []byte) string

Base64.Encode

func GenerateRSAKeys

func GenerateRSAKeys() (pubKeyBytes, priKeyBytes []byte, pubKey *rsa.PublicKey, priKey *rsa.PrivateKey, err error)

func GenerateRSAKeysPKCS1

func GenerateRSAKeysPKCS1() (pubKeyBytes, priKeyBytes []byte, pubKey *rsa.PublicKey, priKey *rsa.PrivateKey, err error)

func GenerateRSAKeysPKCS8

func GenerateRSAKeysPKCS8() (pubKeyBytes, priKeyBytes []byte, pubKey *rsa.PublicKey, priKey *rsa.PrivateKey, err error)

func MD5

func MD5(bs []byte) []byte

func MD5IO

func MD5IO(reader io.Reader) []byte

func MarshalPKCS1PrivateKey

func MarshalPKCS1PrivateKey(key *rsa.PrivateKey) (priKeyBytes []byte)

func MarshalPKCS8PrivateKey

func MarshalPKCS8PrivateKey(key *rsa.PrivateKey) (priKeyBytes []byte, e error)

func PKCS5Padding

func PKCS5Padding(cipherText []byte, blockSize int) []byte

func PKCS5UnPadding

func PKCS5UnPadding(bs []byte) []byte

func ParseRSAPublicKey

func ParseRSAPublicKey(fromPubKeyBytes []byte) (pubKey *rsa.PublicKey, err error)

func RSADecode

func RSADecode(txt []byte, key *rsa.PrivateKey) (originTxt []byte, err error)

func RSAEncode

func RSAEncode(originTxt []byte, key *rsa.PublicKey) (txt []byte, err error)

func RSASign

func RSASign(originTxt []byte, priKey *rsa.PrivateKey) (signature []byte, err error)

func RSAVerify

func RSAVerify(originTxt, signature []byte, pubKey *rsa.PublicKey) error

func RestoreRSAKeys

func RestoreRSAKeys(fromPriKeyBytes []byte) (pubKeyBytes []byte, pubKey *rsa.PublicKey, priKey *rsa.PrivateKey, err error)

func SHA1

func SHA1(bs []byte) []byte

func SHA1IO

func SHA1IO(reader io.Reader) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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