aes

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPadding = errors.New("invalid padding")
)

Functions

func NoPadding

func NoPadding(src []byte, blockSize int) []byte

func NoUnPadding

func NoUnPadding(src []byte) ([]byte, error)

func PKCS7Padding

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

func PKCS7UnPadding

func PKCS7UnPadding(src []byte) ([]byte, error)

func RandBytes

func RandBytes(length int) (data []byte, err error)

func ZeroPadding

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

func ZeroUnPadding

func ZeroUnPadding(src []byte) ([]byte, error)

Types

type Client

type Client struct {
	Key string
	Iv  string
}

func NewClient

func NewClient(key string, iv string) *Client

func (*Client) CBCDecrypt

func (client *Client) CBCDecrypt(encrypted string) string

func (*Client) CBCEncrypt

func (client *Client) CBCEncrypt(text string) string

func (*Client) CFBDecrypt

func (client *Client) CFBDecrypt(encrypted string) string

func (*Client) CFBEncrypt

func (client *Client) CFBEncrypt(text string) string

func (*Client) GCMDecrypt

func (client *Client) GCMDecrypt(encrypted string) string

func (*Client) GCMEncrypt

func (client *Client) GCMEncrypt(text string) string

type Padding

type Padding func(src []byte, blockSize int) []byte

type UnPadding

type UnPadding func(src []byte) []byte

Jump to

Keyboard shortcuts

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