encrypt

package
v0.0.0-...-66fcd57 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

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

AES解密函数,使用CBC模式和PKCS7填充

func AesEncrypt

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

AES加密函数,使用CBC模式和PKCS7填充

func ComparePasswords

func ComparePasswords(hashedPwd string, plainPwd string) bool

func EncryptPassword

func EncryptPassword(pwd string) string

func GenerateAesIV

func GenerateAesIV(blockSize int) string

func MD5

func MD5(s string) string

func PKCS7Padding

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

使用PKCS7进行填充,返回填充后的数据

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

去除PKCS7填充,返回去除填充后的数据

Types

This section is empty.

Jump to

Keyboard shortcuts

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