crypt

package
v0.26.49 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: GPL-3.0 Imports: 21 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 AesDecrypt

func AesDecrypt(crypted, key []byte) ([]byte, error)

de

func AesEncrypt

func AesEncrypt(origData, key []byte) ([]byte, error)

en

func GetCert

func GetCert() tls.Certificate

func GetRandomString

func GetRandomString(l int, id ...int) string

GetRandomString 生成指定长度的随机密钥,支持可选传入id

func InitTls

func InitTls(customCert tls.Certificate)

func Md5

func Md5(s string) string

Generate 32-bit MD5 strings

func NewTlsClientConn

func NewTlsClientConn(conn net.Conn) net.Conn

func NewTlsServerConn

func NewTlsServerConn(conn net.Conn) net.Conn

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int) []byte

Completion when the length is insufficient

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) (error, []byte)

Remove excess

func ReadClientHello

func ReadClientHello(clientConn net.Conn, prefix []byte) (helloInfo *tls.ClientHelloInfo, rawData []byte, err error)

Types

type ReadOnlyConn

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

func (*ReadOnlyConn) Close

func (c *ReadOnlyConn) Close() error

func (*ReadOnlyConn) LocalAddr

func (c *ReadOnlyConn) LocalAddr() net.Addr

func (*ReadOnlyConn) Read

func (c *ReadOnlyConn) Read(p []byte) (int, error)

func (*ReadOnlyConn) RemoteAddr

func (c *ReadOnlyConn) RemoteAddr() net.Addr

func (*ReadOnlyConn) SetDeadline

func (c *ReadOnlyConn) SetDeadline(_ time.Time) error

func (*ReadOnlyConn) SetReadDeadline

func (c *ReadOnlyConn) SetReadDeadline(_ time.Time) error

func (*ReadOnlyConn) SetWriteDeadline

func (c *ReadOnlyConn) SetWriteDeadline(_ time.Time) error

func (*ReadOnlyConn) Write

func (c *ReadOnlyConn) Write(_ []byte) (int, error)

type SniffConn

type SniffConn struct {
	net.Conn

	Rb []byte
	// contains filtered or unexported fields
}

func NewSniffConn

func NewSniffConn(conn net.Conn, maxSize int) *SniffConn

func (*SniffConn) Bytes

func (s *SniffConn) Bytes() []byte

func (*SniffConn) Read

func (s *SniffConn) Read(p []byte) (int, error)

Jump to

Keyboard shortcuts

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