crypto

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NONE = iota
	PaddingZero
	PaddingPKCS5
	PaddingPKCS7
	NoPadding
)
View Source
const (
	ECB = iota
	CBC
	CTR
	OFB
	CFB
)
View Source
const (
	Bit64   = 64
	Bit128  = 128
	Bit256  = 256
	Bit512  = 512
	Bit1024 = 1024
	Bit2048 = 2048
	Bit4096 = 4096
)
View Source
const (
	PirTypEC = iota
	PirTypPKCS1
	PirTypPKCS8
)
View Source
const (
	SignTypSHA1   = crypto.SHA1
	SignTypSHA256 = crypto.SHA256
	SignTypSHA512 = crypto.SHA512
	SignTypMD5    = crypto.MD5
)

Variables

This section is empty.

Functions

func Base64

func Base64(raw []byte) string

Base64

func FromBase64

func FromBase64(raw string) ([]byte, error)

func FromHex

func FromHex(raw string) ([]byte, error)

func Hex

func Hex(raw []byte) string

HEX

func NewECBDecrypter

func NewECBDecrypter(b cipher.Block) cipher.BlockMode

func NewECBEncrypter

func NewECBEncrypter(b cipher.Block) cipher.BlockMode

func PKCS5Padding

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

PKCS5

func PKCS5UnPadding

func PKCS5UnPadding(r []byte) []byte

func PKCS7Padding

func PKCS7Padding(r []byte, blockSize int) []byte

PKCS7

func PKCS7UnPadding

func PKCS7UnPadding(r []byte) []byte

func Padding

func Padding(r []byte, typ, bz int) []byte

func UnPadding

func UnPadding(r []byte, typ int) []byte

func ZeroPadding

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

Zero padding

func ZeroUnPadding

func ZeroUnPadding(r []byte) []byte

Types

This section is empty.

Directories

Path Synopsis
sha

Jump to

Keyboard shortcuts

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