Documentation
¶
Index ¶
Constants ¶
View Source
const CRYPTER_KEY = "ServerName" + "@2025"
服务名称+salt
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AESCrypter ¶
type AESCrypter struct {
// contains filtered or unexported fields
}
AESCrypter 使用AES进行对称加密
type ECCCrypter ¶
type ECCCrypter struct {
// contains filtered or unexported fields
}
ECCCrypter 使用ECDH进行密钥交换和加密
func (*ECCCrypter) Decrypt ¶
func (c *ECCCrypter) Decrypt(cryptoText string) (string, error)
Decrypt 使用ECC私钥解密数据
func (*ECCCrypter) Encrypt ¶
func (c *ECCCrypter) Encrypt(plaintext string) (string, error)
Encrypt 使用ECC公钥加密数据
func (*ECCCrypter) GetPublicKeyBase64 ¶
func (c *ECCCrypter) GetPublicKeyBase64() string
GetPublicKeyBase64 返回公钥的Base64编码
func (*ECCCrypter) SetPublicKeyBase64 ¶
func (c *ECCCrypter) SetPublicKeyBase64(publicKeyBase64 string) error
SetPublicKeyBase64 设置公钥
type HybridCrypter ¶
type HybridCrypter struct {
// contains filtered or unexported fields
}
HybridCrypter 混合加密器
func InitHybridCrypter ¶
func InitHybridCrypter() *HybridCrypter
func NewHybridCrypter ¶
func NewHybridCrypter(keyPath string) (*HybridCrypter, error)
NewHybridCrypter 创建混合加密器
type SHA384Crypter ¶
type SHA384Crypter struct {
// contains filtered or unexported fields
}
var Instance *SHA384Crypter
func NewSHA384Crypter ¶
func NewSHA384Crypter(key string) *SHA384Crypter
NewSHA384Crypter 创建新的 SHA-384 加密器
func (*SHA384Crypter) Encrypt ¶
func (c *SHA384Crypter) Encrypt(password string) string
Encrypt 使用 HMAC-SHA-384 加密密码
func (*SHA384Crypter) Verify ¶
func (c *SHA384Crypter) Verify(password, encryptedPassword string) bool
Verify 验证密码是否匹配加密值
Click to show internal directories.
Click to hide internal directories.