crypt

package
v0.26.53 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: GPL-3.0 Imports: 21 Imported by: 0

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