secure

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BcryptHash added in v0.14.1

func BcryptHash(password string) (string, error)

BcryptHash 使用 bcrypt 对密码进行哈希

func BcryptVerify added in v0.14.1

func BcryptVerify(password, hashedPassword string) bool

BcryptVerify 验证密码是否匹配存储的哈希值

func Des3Decrypt

func Des3Decrypt(s, p string) (string, error)

Des3Decrypt 使用 DES3-CBC 解密字符串 参数 s: 加密后的十六进制字符串, p: 密钥

func Des3Encrypt

func Des3Encrypt(s, p string) (string, error)

Des3Encrypt 使用 DES3-CBC 加密字符串 参数 s: 待加密字符串, p: 密钥

func FileMD5sum

func FileMD5sum(path string) (string, error)

FileMD5sum 计算文件 MD5 哈希

func IsBcrypt added in v0.14.1

func IsBcrypt(password string) bool

IsBcrypt 检查密码是否是 bcrypt 格式

func MD5sum

func MD5sum(s string) string

MD5sum 计算 MD5 哈希

func NewSSHKeypair

func NewSSHKeypair() (string, string, error)

NewSSHKeypair 生成 SSH 密钥对

func NewSSHPublicKey

func NewSSHPublicKey(privatekey *rsa.PublicKey) ([]byte, error)

NewSSHPublicKey 生成 SSH 公钥

Types

This section is empty.

Jump to

Keyboard shortcuts

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