Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPSKTooShort = fmt.Errorf("PSK must be at least %d bytes", smPSKMinLen)
Functions ¶
func WrapPacketConn ¶
func WrapPacketConn(conn net.PacketConn, obfs Obfuscator) net.PacketConn
WrapPacketConn enables obfuscation on a net.PacketConn. The obfuscation is transparent to the caller - the n bytes returned by ReadFrom and WriteTo are the number of original bytes, not after obfuscation/deobfuscation.
Types ¶
type Obfuscator ¶
Obfuscator is the interface that wraps the Obfuscate and Deobfuscate methods. Both methods return the number of bytes written to out. If a packet is not valid, the methods should return 0.
type SalamanderObfuscator ¶
type SalamanderObfuscator struct { PSK []byte RandSrc *rand.Rand // contains filtered or unexported fields }
SalamanderObfuscator is an obfuscator that obfuscates each packet with the BLAKE2b-256 hash of a pre-shared key combined with a random salt. Packet format: [8-byte salt][payload]
func NewSalamanderObfuscator ¶
func NewSalamanderObfuscator(psk []byte) (*SalamanderObfuscator, error)
func (*SalamanderObfuscator) Deobfuscate ¶
func (o *SalamanderObfuscator) Deobfuscate(in, out []byte) int
func (*SalamanderObfuscator) Obfuscate ¶
func (o *SalamanderObfuscator) Obfuscate(in, out []byte) int
Click to show internal directories.
Click to hide internal directories.