crypto

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 10 Imported by: 0

README

Documentation

Index

Constants

View Source
const (
	AesBlockSize = 16
)

Variables

This section is empty.

Functions

func Md5File

func Md5File(file io.Reader) (string, error)

func Md5FileByPath

func Md5FileByPath(path string) (string, error)

func Md5String

func Md5String(data []byte) string

func Sha1String

func Sha1String(data []byte) string

Types

type AesCBCCrypter

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

func NewAesCBCCrypter

func NewAesCBCCrypter(key []byte, iv []byte) (*AesCBCCrypter, error)

func (*AesCBCCrypter) BlockSize

func (a *AesCBCCrypter) BlockSize() int

func (*AesCBCCrypter) Decrypt

func (a *AesCBCCrypter) Decrypt(crypted []byte) []byte

func (*AesCBCCrypter) Encrypt

func (a *AesCBCCrypter) Encrypt(data []byte) []byte

func (*AesCBCCrypter) SetPadding

func (a *AesCBCCrypter) SetPadding(padding PaddingInterface)

type PKCS5Padding

type PKCS5Padding struct {
	BlockSize int
}

func (*PKCS5Padding) Padding

func (p *PKCS5Padding) Padding(data []byte) []byte

func (*PKCS5Padding) UnPadding

func (p *PKCS5Padding) UnPadding(data []byte) []byte

type PaddingInterface

type PaddingInterface interface {
	Padding(data []byte) []byte
	UnPadding(data []byte) []byte
}

Jump to

Keyboard shortcuts

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