gf: Index | Files

package gaes

import ""

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


Package Files


func Decrypt Uses

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

Decrypt is alias of DecryptCBC.

func DecryptCBC Uses

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

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

func DecryptCFB Uses

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

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

func Encrypt Uses

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

Encrypt is alias of EncryptCBC.

func EncryptCBC Uses

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

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

func EncryptCFB Uses

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

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

func PKCS5Padding Uses

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

func PKCS5UnPadding Uses

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

func ZeroPadding Uses

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

func ZeroUnPadding Uses

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

Package gaes imports 4 packages (graph) and is imported by 2 packages. Updated 2019-07-03. Refresh now. Tools for package owners.