Documentation ¶
Index ¶
- Variables
- func AesDecrypt(data []byte, key []byte) ([]byte, error)
- func AesEncrypt(data []byte, key []byte) ([]byte, error)
- func DecryptByAes(data string) ([]byte, error)
- func DecryptFile(sourceFile, destFile string) (err error)
- func EncryptByAes(data []byte) (string, error)
- func EncryptFile(filePath, fName string) (err error)
- func GetCurrentAbPathByCaller() string
- func GetPathBySuffix(path string, suffix string) []string
- func MoveChildToParent(dirPath string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var PwdKey = []byte("ABCDABCDABCDABCD") //key不能泄露
Functions ¶
func AesDecrypt ¶
AesDecrypt 解密 解密过程相反 16,24,32位字符串的话,分别对应AES-128,AES-192,AES-256 加密方法
func AesEncrypt ¶
AesEncrypt 加密 加密过程:
1、处理数据,对数据进行填充,采用PKCS7(当密钥长度不够时,缺几位补几个几)的方式。 2、对数据进行加密,采用AES加密方法中CBC加密模式 3、对得到的加密数据,进行base64加密,得到字符串
func EncryptFile ¶
更新 文件 的加解密 EncryptFile 文件加密,filePath 需要加密的文件路径 ,fName加密后文件名
func GetCurrentAbPathByCaller ¶
func GetCurrentAbPathByCaller() string
func GetPathBySuffix ¶
func MoveChildToParent ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.