cryptoPlus

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 26 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecryptCBC

func AESDecryptCBC(ciphertext, key []byte) ([]byte, error)

AESDecryptCBC cbc 解密

func AESDecryptGCM

func AESDecryptGCM(ciphertext []byte, key []byte) ([]byte, error)

func AESEncryptCBC

func AESEncryptCBC(plaintext []byte, key []byte) (string, error)

AESEncryptCBC CBC 加密

func AESEncryptGCM

func AESEncryptGCM(Content []byte, key []byte) (string, error)

func AESEncryptGCM2

func AESEncryptGCM2(Content []byte, key []byte) (string, error)

func Base64Decode

func Base64Decode(str string) string

Base64Decode 解密

func Base64Encode

func Base64Encode(str string) string

Base64Encode 加密

func GeneratePassWd

func GeneratePassWd(src string) []byte

GeneratePassWd 生成密码

func GenerateRsaKey

func GenerateRsaKey(keySize int) error

GenerateRsaKey 生成rsa密钥对,并且保存到磁盘中

func GetEncoding

func GetEncoding(contentType string, body []byte) string

GetEncoding 获取编码

func RsaPrivateDecode

func RsaPrivateDecode(cipherText []byte, private []byte) []byte

RsaPrivateDecode 使用rsa私钥解密

func RsaPublicEncode

func RsaPublicEncode(plainText []byte, filename string) []byte

RsaPublicEncode 使用rsa公钥加密文件

func SHA256Sum

func SHA256Sum(data any) string

func ToMD5

func ToMD5(str string) string

func ToSha256

func ToSha256(str, keyStr string) string

func TransCode

func TransCode(body []byte, encode string) string

TransCode 转码

func ValidateBcryptPassWd

func ValidateBcryptPassWd(src string, passWd string) bool

ValidateBcryptPassWd 验证密码 第一个参数是明文 第二个参数是密文

Types

type TLSData

type TLSData struct {
	TLSVersion               string   `json:"tls_version,omitempty"`
	ExtensionServerName      string   `json:"extension_server_name,omitempty"`
	DNSNames                 []string `json:"dns_names,omitempty"`
	Emails                   []string `json:"emails,omitempty"`
	CommonName               []string `json:"common_name,omitempty"`
	Organization             []string `json:"organization,omitempty"`
	IssuerCommonName         []string `json:"issuer_common_name,omitempty"`
	IssuerOrg                []string `json:"issuer_organization,omitempty"`
	FingerprintSHA256        string   `json:"fingerprint_sha256,omitempty"`
	FingerprintSHA256OpenSSL string   `json:"fingerprint_sha256_openssl,omitempty"`
}

TLSData contains the relevant Transport Layer Security information

func TLSGrab

func TLSGrab(c *tls.ConnectionState) *TLSData

TLSGrab fills the TLSData

Jump to

Keyboard shortcuts

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