crypto

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockSizeMIN = 16 // AES-128
	BlockSizeMID = 24 // AES-192
	BlockSizeMAX = 32 // AES-256
)

const .

Variables

This section is empty.

Functions

func ParsePrivateKey

func ParsePrivateKey(raw string) (result []byte)

ParsePrivateKey parse raw priv key to pem formation

func ParsePublicKey

func ParsePublicKey(raw string) (result []byte)

ParsePublicKey parse raw public key to pem formation

Types

type Alipay

type Alipay struct {
	// contains filtered or unexported fields
}

Alipay alipay cryptor

func NewAlipay

func NewAlipay(aliPub, biliPriv string) (a *Alipay)

NewAlipay is.

func (*Alipay) EncryptParam

func (e *Alipay) EncryptParam(p url.Values) (ep string, err error)

EncryptParam rsa encrypt.

func (*Alipay) SignParam

func (e *Alipay) SignParam(p url.Values) (sign string, err error)

SignParam sign alipay param

type Main

type Main struct {
	// contains filtered or unexported fields
}

Main mainsite cryptor

func NewMain

func NewMain(pub, priv string) (e *Main)

NewMain is.

func (*Main) AESDecrypt

func (e *Main) AESDecrypt(key, text []byte, mod int) (data []byte, err error)

AESDecrypt AES-128, AES-192, or AES-256 decrypt. mod 16, 24, or 32 bytes

func (*Main) AESEncrypt

func (e *Main) AESEncrypt(key, text []byte, mod int) (data []byte, err error)

AESEncrypt AES-128, AES-192, or AES-256 encrypt. mod 16, 24, or 32 bytes

func (*Main) IMGDecrypt

func (e *Main) IMGDecrypt(raw []byte) (data []byte, err error)

IMGDecrypt rsa + AES-128

func (*Main) IMGEncrypt

func (e *Main) IMGEncrypt(raw []byte) (data []byte, err error)

IMGEncrypt rsa + AES-128

func (*Main) RsaDecrypt

func (e *Main) RsaDecrypt(text []byte) (data []byte, err error)

RsaDecrypt rsa decrypt.

func (*Main) RsaEncrypt

func (e *Main) RsaEncrypt(text []byte) (data []byte, err error)

RsaEncrypt rsa encrypt.

Jump to

Keyboard shortcuts

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