encry

package
v0.0.0-...-3b8fdc3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparePassword

func ComparePassword(hashedPassword, password string) error

ComparePassword 密码比较

func FileMd5

func FileMd5(file string) (string, error)

FileMd5 文件加密

func Md5

func Md5(str string) string

Md5 md5加密

func PKCS5Adding

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

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func ScryptPasswd

func ScryptPasswd(password string) string

ScryptPasswd 密码 + 盐(一串随机数) 再Hash加密

func Sha256

func Sha256(str string) string

Sha256 加密

func Sha512

func Sha512(str string) string

Sha512 加密

Types

type AesEncrypt

type AesEncrypt struct {
	// contains filtered or unexported fields
}

func NewAesEncryptInstance

func NewAesEncryptInstance(key string, secret string) (*AesEncrypt, error)

func (*AesEncrypt) AesBase64Decrypt

func (a *AesEncrypt) AesBase64Decrypt(b string) (string, error)

AesBase64Decrypt aes Base64 解密

func (*AesEncrypt) AesBase64Encrypt

func (a *AesEncrypt) AesBase64Encrypt(in string) (string, error)

AesBase64Encrypt aes Base64 加密

Jump to

Keyboard shortcuts

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