tools

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Encodings = [3]string{"base64", "base32", "hex"}

/ Available encodings type

Functions

func CreateTmpProjectRoot

func CreateTmpProjectRoot(path string, persist string) error

func DecryptAES

func DecryptAES(encrypted []byte, key []byte) ([]byte, error)

func DecryptBlowfish

func DecryptBlowfish(toDecrypt []byte, key []byte) ([]byte, error)

func DecryptChacha20

func DecryptChacha20(toDecrypt []byte, key []byte) ([]byte, error)

func DecryptXOR

func DecryptXOR(toDecrypt []byte, key []byte) ([]byte, error)

func DirExists

func DirExists(dir string) (bool, error)

func EncodeForInterpolation

func EncodeForInterpolation(method BytesEncodingType, toEncode []byte) string

/ Encode a series of bytes so that it can be interpolated into a template

func EncryptAES

func EncryptAES(toEncrypt []byte, key []byte) ([]byte, error)

func EncryptBlowfish

func EncryptBlowfish(toCrypt []byte, key []byte) ([]byte, error)

func EncryptChacha20

func EncryptChacha20(toCrypt []byte, key []byte) ([]byte, error)

func EncryptXOR

func EncryptXOR(toEncrypt []byte, key []byte) ([]byte, error)

func FindAndExecute added in v1.2.2

func FindAndExecute(
	hashing_algorithm func(string) string,
	functionName string,
	dllName string,
) error

func GetAESTemplate

func GetAESTemplate() string

func GetBlowfishTemplate

func GetBlowfishTemplate() string

func GetChacha20Template

func GetChacha20Template() string

func GetMainTemplate

func GetMainTemplate(
	encoding string,
	key string,
	sc string,
	sleepTime uint,
	persistData string,
	shouldExport bool,
) string

func GetPersistTemplate added in v1.2.0

func GetPersistTemplate() string

func GetXORTemplate

func GetXORTemplate() string

func MoveFile

func MoveFile(sourcePath, destPath string) error

func RandomString

func RandomString(n int) string

func ReadFile

func ReadFile(filepath string) ([]byte, error)

func WriteToFile

func WriteToFile(outfile string, filname string, toWrite string) error

Types

type BytesEncodingType

type BytesEncodingType string

/ Enum type that defines which bytes encoding to use / in template source-code

const (
	EncodingBase64 BytesEncodingType = "base64"
	EncodingBase32 BytesEncodingType = "base32"
	EncodingHex    BytesEncodingType = "hex"
)

func SelectRandomEncodingType

func SelectRandomEncodingType() BytesEncodingType

/ Select a random encoding type

func (*BytesEncodingType) Set

func (e *BytesEncodingType) Set(v string) error

/ Set must have pointer receiver so it doesn't change the value of a copy

func (*BytesEncodingType) String

func (e *BytesEncodingType) String() string

String is used both by fmt.Print and by Cobra in help text

func (*BytesEncodingType) Type

func (e *BytesEncodingType) Type() string

/ Type is only used in help text

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL