crypt

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 11 Imported by: 0

README

crypt

Crypt Instances

Documentation

Index

Constants

View Source
const AESModeCBC = "cbc"

AESModeCBC 密码分组链接模式(Cipher Block Chaining (CBC))

View Source
const AESModeCFB = "cfb"

AESModeCFB 密码反馈模式(Cipher FeedBack (CFB))

View Source
const AESModeCTR = "ctr"

AESModeCTR 计算器模式(Counter (CTR))

View Source
const AESModeOFB = "ofb"

AESModeOFB 输出反馈模式(Output FeedBack (OFB))

Variables

This section is empty.

Functions

func GenAESKey

func GenAESKey() string

GenAESKey 生成AES密钥

Types

type AES

type AES struct {
	Key  string
	Mode string
	// contains filtered or unexported fields
}

AES AES结构体

func NewAES

func NewAES(key string, mode string) (*AES, error)

NewAES 创建AES实例

func (*AES) Decrypt

func (receiver *AES) Decrypt(cipherText string) string

Decrypt AES解密

func (*AES) Encrypt

func (receiver *AES) Encrypt(plainText string) string

Encrypt AES加密

type RSA

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

RSA RSA结构体

func NewRSA

func NewRSA() *RSA

NewRSA 创建RSA实例

func (*RSA) Decrypt

func (receiver *RSA) Decrypt(cipherText string) string

Decrypt RSA解密

func (*RSA) Encrypt

func (receiver *RSA) Encrypt(plainText string) string

Encrypt RSA加密

func (*RSA) ImportPrivateKey

func (receiver *RSA) ImportPrivateKey(privateKey string) error

ImportPrivateKey 导入RSA私钥

func (*RSA) ImportPublicKey

func (receiver *RSA) ImportPublicKey(publicKey string) error

ImportPublicKey 导入RSA公钥

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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