Documentation
¶
Index ¶
- func DecryptAESGCM(key []byte, ciphertext []byte) ([]byte, error)
- func DecryptChaCha20Poly1305(key []byte, ciphertext []byte) ([]byte, error)
- func DeriveKey(secret string) []byte
- func EncryptAESGCM(key []byte, plaintext []byte) ([]byte, error)
- func EncryptChaCha20Poly1305(key []byte, plaintext []byte) ([]byte, error)
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) GenerateFakeClientHello(sni string, sessionID string) ([]byte, error)
- func (c *Connection) HandshakeClient(sni string, sessionID string) error
- func (c *Connection) HandshakeServer() (string, string, []byte, error)
- func (c *Connection) LocalAddr() net.Addr
- func (c *Connection) Read(b []byte) (int, error)
- func (c *Connection) ReadTLSRecord() ([]byte, error)
- func (c *Connection) RemoteAddr() net.Addr
- func (c *Connection) SetDeadline(t time.Time) error
- func (c *Connection) SetReadDeadline(t time.Time) error
- func (c *Connection) SetWriteDeadline(t time.Time) error
- func (c *Connection) Write(b []byte) (int, error)
- func (c *Connection) WriteTLSRecord(payload []byte) error
- type Protocol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptAESGCM ¶
DecryptAESGCM is deprecated, use DecryptChaCha20Poly1305 instead Kept for backward compatibility with legacy code Deprecated: Use DecryptChaCha20Poly1305 for better performance and security
func DecryptChaCha20Poly1305 ¶ added in v0.3.5
DecryptChaCha20Poly1305 decrypts ciphertext using ChaCha20-Poly1305 Expects format: [nonce(24 bytes)][ciphertext+tag]
func DeriveKey ¶
DeriveKey creates a 32-byte key from a string (e.g., UUID) using SHA-256 The derived key is suitable for ChaCha20-Poly1305
func EncryptAESGCM ¶
EncryptAESGCM is deprecated, use EncryptChaCha20Poly1305 instead Kept for backward compatibility with legacy code Deprecated: Use EncryptChaCha20Poly1305 for better performance and security
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection wraps a net.Conn with Mimic protocol logic
func Dial ¶
func Dial(address string, secret string) (*Connection, error)
Dial connects to the remote address using protected dialer. Uses Android VpnService protection when available.
func NewConnection ¶
func NewConnection(conn net.Conn, secret string) *Connection
NewConnection creates a new Mimic connection wrapper
func (*Connection) Close ¶
func (c *Connection) Close() error
Close closes the underlying connection
func (*Connection) GenerateFakeClientHello ¶
func (c *Connection) GenerateFakeClientHello(sni string, sessionID string) ([]byte, error)
GenerateFakeClientHello leverages uTLS to generate a robust Chrome fingerprint
func (*Connection) HandshakeClient ¶
func (c *Connection) HandshakeClient(sni string, sessionID string) error
HandshakeClient performs the client-side handshake
func (*Connection) HandshakeServer ¶
func (c *Connection) HandshakeServer() (string, string, []byte, error)
HandshakeServer peeks at the ClientHello. Returns SNI, SessionID, the peeked hello bytes, and error.
func (*Connection) LocalAddr ¶
func (c *Connection) LocalAddr() net.Addr
LocalAddr returns the local network address
func (*Connection) Read ¶
func (c *Connection) Read(b []byte) (int, error)
Read reads data, stripping the TLS 1.3 Application Data record framing
func (*Connection) ReadTLSRecord ¶
func (c *Connection) ReadTLSRecord() ([]byte, error)
ReadTLSRecord reads a TLS 1.3 Application Data record
func (*Connection) RemoteAddr ¶
func (c *Connection) RemoteAddr() net.Addr
RemoteAddr returns the remote network address
func (*Connection) SetDeadline ¶
func (c *Connection) SetDeadline(t time.Time) error
SetDeadline sets the read and write deadlines
func (*Connection) SetReadDeadline ¶
func (c *Connection) SetReadDeadline(t time.Time) error
SetReadDeadline sets the deadline for future Read calls
func (*Connection) SetWriteDeadline ¶
func (c *Connection) SetWriteDeadline(t time.Time) error
SetWriteDeadline sets the deadline for future Write calls
func (*Connection) Write ¶
func (c *Connection) Write(b []byte) (int, error)
Write sends data, wrapping it in a TLS 1.3 Application Data record
func (*Connection) WriteTLSRecord ¶
func (c *Connection) WriteTLSRecord(payload []byte) error
WriteTLSRecord wraps payload in a TLS 1.3 Application Data record
type Protocol ¶
type Protocol interface {
// Handshake establishes a secure connection with the server
Handshake() error
// Send transmits data with the current mimicry pattern
Send(data []byte) (int, error)
// Receive reads data from the connection
Receive() ([]byte, error)
}
Protocol defines the core interface for the Mimic protocol. It handles the obfuscation and transmission of data.