Documentation
¶
Overview ¶
Package mse implements Message Stream Encryption (MSE/PE) as used by BitTorrent clients to obfuscate protocol traffic and avoid ISP throttling.
The protocol uses Diffie-Hellman key exchange with a 768-bit prime, followed by RC4 encryption of the stream. Both "encrypt headers only" (plaintext) and "full stream" (RC4) modes are supported.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandshakeOutgoing ¶
func HandshakeOutgoing(conn net.Conn, infoHash [20]byte, preferred CryptoMethod) (*Conn, CryptoMethod, error)
HandshakeOutgoing performs MSE handshake as the initiator (connecting party). infoHash is required to derive encryption keys. Returns an encrypted Conn and the crypto method negotiated.
Types ¶
type CryptoMethod ¶
type CryptoMethod uint32
CryptoMethod selects the payload encryption method.
const ( CryptoPlaintext CryptoMethod = 0x01 CryptoRC4 CryptoMethod = 0x02 )
Click to show internal directories.
Click to hide internal directories.