gaes

package
v1.8.4-0...-cbac34e Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package gaes provides useful API for AES encryption/decryption algorithms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(cipherText []byte, key []byte, iv ...[]byte) ([]byte, error)

Decrypt is alias of DecryptCBC.

func DecryptCBC

func DecryptCBC(cipherText []byte, key []byte, iv ...[]byte) ([]byte, error)

AES解密, 使用CBC模式,注意key必须为16/24/32位长度,iv初始化向量为非必需参数

func DecryptCFB

func DecryptCFB(cipherText []byte, key []byte, unpadding int, iv ...[]byte) ([]byte, error)

AES解密, 使用CFB模式。 注意key必须为16/24/32位长度,unpadding为去补位长度,iv初始化向量为非必需参数。

func Encrypt

func Encrypt(plainText []byte, key []byte, iv ...[]byte) ([]byte, error)

Encrypt is alias of EncryptCBC.

func EncryptCBC

func EncryptCBC(plainText []byte, key []byte, iv ...[]byte) ([]byte, error)

AES加密, 使用CBC模式,注意key必须为16/24/32位长度,iv初始化向量为非必需参数。

func EncryptCFB

func EncryptCFB(plainText []byte, key []byte, padding *int, iv ...[]byte) ([]byte, error)

AES加密, 使用CFB模式。 注意key必须为16/24/32位长度,padding返回补位长度,iv初始化向量为非必需参数。

func PKCS5Padding

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

func PKCS5UnPadding

func PKCS5UnPadding(src []byte, blockSize int) ([]byte, error)

func ZeroPadding

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

func ZeroUnPadding

func ZeroUnPadding(plaintext []byte, unpadding int) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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