cyrpt

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(attemptedPassword, encryptedPassword, salt string) bool

Authenticate 对输入的密码进行验证

@param attemptedPassword 待验证的密码 @param encryptedPassword 密文 @param salt 盐值 @return 是否验证成功

func Decrypt

func Decrypt(cryptic, key []byte) ([]byte, error)

func Encrypt

func Encrypt(origData, key []byte) ([]byte, error)

func EncryptedPassword

func EncryptedPassword(rawPwd string, salt string) string

EncryptedPassword 生成密文

@param rawPwd 明文密码 @param salt 盐值

func GenerateSalt

func GenerateSalt() string

GenerateSalt 通过提供加密的强随机数生成器 生成盐

func MD5

func MD5(origData string) string

MD5 给指定的字符串进行MD5加密

func PBKDF2

func PBKDF2(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte

func PKCS5Padding

func PKCS5Padding(cipher []byte, blockSize int) []byte

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func SHA1

func SHA1(data []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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