crypto

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UseAES = new(AES)
View Source
var UseMD5 = new(MD5)
View Source
var UseRSA = new(RSA)

Functions

This section is empty.

Types

type AES

type AES struct {
}

func (*AES) Decrypt

func (e *AES) Decrypt(data []byte, key []byte) ([]byte, error)

Decrypt 使用AES解密数据

func (*AES) Encrypt

func (e *AES) Encrypt(data []byte, key []byte) ([]byte, error)

Encrypt 使用AES加密数据

type Crypto

type Crypto interface {
	Encrypt(data []byte, key []byte) ([]byte, error)
	Decrypt(data []byte, key []byte) ([]byte, error)
}

Crypto 定义加密接口

type MD5

type MD5 struct {
}

func (*MD5) Compare

func (ist *MD5) Compare(input, salt, hash string) bool

func (*MD5) Encrypt

func (ist *MD5) Encrypt(input, key string) string

type RSA

type RSA struct{}

func (*RSA) Decrypt

func (ist *RSA) Decrypt(data []byte, key []byte) ([]byte, error)

Decrypt 使用 RSA 私钥解密数据

func (*RSA) Encrypt

func (ist *RSA) Encrypt(data []byte, key []byte) ([]byte, error)

Encrypt 使用 RSA 公钥加密数据

Jump to

Keyboard shortcuts

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