XPlus obfs & don't frag

This commit is contained in:
Toby
2021-04-19 20:52:50 -07:00
parent eb9006bd0d
commit b80db1fc19
11 changed files with 173 additions and 14 deletions

View File

@@ -2,12 +2,12 @@ package obfs
type XORObfuscator []byte
func (x XORObfuscator) Deobfuscate(buf []byte, n int) int {
func (x XORObfuscator) Deobfuscate(in []byte, out []byte) int {
l := len(x)
for i := range buf {
buf[i] ^= x[i%l]
for i := range in {
out[i] = in[i] ^ x[i%l]
}
return n
return len(in)
}
func (x XORObfuscator) Obfuscate(p []byte) []byte {