Documentation ¶
Index ¶
- func Base64Decode(in []byte) (out []byte, err error)
- func Base64Encode(in []byte) (out []byte)
- func Deobfuscate(input []byte, chain []Obfuscator) (out []byte, err error)
- func Obfuscate(input []byte, chain []Obfuscator) (out []byte, err error)
- func ParseObfuscators(obfConfigs *[]ObfuscatorConfig) (chain *[]Obfuscator, failures []string)
- func UnparseObfuscators(obfs *[]Obfuscator) *[]ObfuscatorConfig
- type AES
- type Base64
- type Blowfish
- type Obfuscator
- type ObfuscatorConfig
- type Twofish
- type XOR
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func Deobfuscate ¶
func Deobfuscate(input []byte, chain []Obfuscator) (out []byte, err error)
Deobfuscate operates on a chain of Obfuscator objects and returns the deobfuscated output
func Obfuscate ¶
func Obfuscate(input []byte, chain []Obfuscator) (out []byte, err error)
Obfuscate operates on a chain of Obfuscator objects and returns the obfuscated output
func ParseObfuscators ¶
func ParseObfuscators(obfConfigs *[]ObfuscatorConfig) (chain *[]Obfuscator, failures []string)
ParseObfuscators parses a slice of ObfuscatorConfig structs into a chain of Obfuscator objects.
func UnparseObfuscators ¶
func UnparseObfuscators(obfs *[]Obfuscator) *[]ObfuscatorConfig
UnparseObfuscators parses a slice of objects that implement obfuscate.Obfuscator and returns a slice of pointers to ObfuscatorConfig structs.
Types ¶
type AES ¶
type AES struct {
Key string `json:"key"`
}
AES structure maintains a key value and satisfies Obfuscator interface.
func (*AES) Deobfuscate ¶
Deobfuscate AES decrypts input bytes. Returns decrypted output and an error value.
type Base64 ¶
type Base64 struct {
Rounds uint `json:"rounds"`
}
Base64 structure maintains a rounds value and satisfies Obfuscator interface.
func (*Base64) Deobfuscate ¶
Deobfuscate Base64 decodes input bytes by a number of rounds. Returns decoded output and an error value.
type Blowfish ¶
Blowfish structure maintains a key and salt value and satisfies Obfuscator interface. Salt is optional.
func (*Blowfish) Deobfuscate ¶
Deobfuscate Blowfish decrypts input bytes, optionally salted. Returns decrypted output and an error value.
type Obfuscator ¶
type Obfuscator interface { Obfuscate(input []byte) (output []byte, err error) Deobfuscate(input []byte) (output []byte, err error) }
Obfuscator interface allows for homogenous obfuscation chaining.
func MapToAlgorithm ¶
func MapToAlgorithm(name string) (o Obfuscator, ok bool)
MapToAlgorithm maps the name of an obfuscation algorithm back to the proper type.
type ObfuscatorConfig ¶
type ObfuscatorConfig struct { Algo string `nonzero:"" mapstructure:"algo" json:"algo" yaml:"algo"` Config map[string]interface{} `nonzero:"" mapstructure:"config" json:"config" yaml:"config"` }
ObfuscatorConfig represents a configuration for an Obfuscator.
type Twofish ¶
type Twofish struct {
Key string `json:"key"`
}
Twofish structure maintains a key value and satisfies Obfuscator interface.
func (*Twofish) Deobfuscate ¶
Deobfuscate Twofish encrypts input bytes. Returns decrypted output and an error value.
type XOR ¶
type XOR struct {
Key string `json:"key"`
}
XOR structure maintains a key value and satisfies Obfuscator interface.
func (*XOR) Deobfuscate ¶
Deobfuscate XOR decrypts input bytes. Returns decrypted output and an error value.