symmetric

package
v0.0.0-...-5f1ca4c Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//iv 的默认长度
	IV_DEFAULT_SIZE    = (1 << 4)
	DEFAULT_KEY_STRING = "ED938EAD32CF11EC97F80242AC110002"
	DEFAULT_IV_STRING  = "FA91506032CF11EC97F80242AC110002"
)

Variables

This section is empty.

Functions

func AesCryptoKey

func AesCryptoKey(keyStr string, aesSize int) (key, iv []byte)

AesCryptoKey 指定长度 密钥key 长度必须为16(AES-128)、24(AES-192)、或32(AES-256)

func AesCryptoKeyWithIv

func AesCryptoKeyWithIv(keyStr, ivStr string, aesSize int) (key, iv []byte)

AesCryptoKeyWithIv 独立key iv 密钥key 长度必须为16(AES-128)、24(AES-192)、或32(AES-256)

func AesDecrypt

func AesDecrypt(src, dst string, key, iv []byte) error

AesDecrypt 解密

func AesDecryptString

func AesDecryptString(src string, key, iv []byte) (dst string, err error)

AesDecryptString 解密

func AesEncrypt

func AesEncrypt(src, dst string, key, iv []byte) (string, error)

AesEncrypt 加密 ,读取文件在加密写新文件

func AesEncryptString

func AesEncryptString(src string, key, iv []byte) (dst string, err error)

AesEncryptString 加密

func AesEncryptV1

func AesEncryptV1(result string, fileName string, key, iv []byte) string

AesEncryptV1 直接读取数据输出就直接加密(单文件)

func DefaultAesCryptoKey

func DefaultAesCryptoKey(keyStr string) (key, iv []byte)

DefaultAesCryptoKey 默认16 密钥key 长度必须为16(AES-128)、24(AES-192)、或32(AES-256)

Types

This section is empty.

Jump to

Keyboard shortcuts

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