files

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PwdKey = []byte("ABCDABCDABCDABCD") //key不能泄露

Functions

func AesDecrypt

func AesDecrypt(data []byte, key []byte) ([]byte, error)

AesDecrypt 解密 解密过程相反 16,24,32位字符串的话,分别对应AES-128,AES-192,AES-256 加密方法

func AesEncrypt

func AesEncrypt(data []byte, key []byte) ([]byte, error)

AesEncrypt 加密 加密过程:

1、处理数据,对数据进行填充,采用PKCS7(当密钥长度不够时,缺几位补几个几)的方式。
2、对数据进行加密,采用AES加密方法中CBC加密模式
3、对得到的加密数据,进行base64加密,得到字符串

func DecryptByAes

func DecryptByAes(data string) ([]byte, error)

DecryptByAes Aes 解密

func DecryptFile

func DecryptFile(sourceFile, destFile string) (err error)

DecryptFile 文件解密

func EncryptByAes

func EncryptByAes(data []byte) (string, error)

EncryptByAes Aes加密 后 base64 再加

func EncryptFile

func EncryptFile(filePath, fName string) (err error)

更新 文件 的加解密 EncryptFile 文件加密,filePath 需要加密的文件路径 ,fName加密后文件名

func GetCurrentAbPathByCaller

func GetCurrentAbPathByCaller() string

func GetPathBySuffix

func GetPathBySuffix(path string, suffix string) []string

func MoveChildToParent

func MoveChildToParent(dirPath string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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