recipe

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package recipe is a CyberChef-style operation pipeline for RF payloads. A recipe is an ordered list of steps; each step is either a TRANSFORM (it rewrites the working buffer — XOR, a cipher decrypt, a bit reversal, a spectral inversion) or an ANALYSIS (it measures the current buffer — entropy, randomness — without changing it). The bytes flow from one step to the next, so an analyst can encode the de-obfuscation sequence they repeat by hand (e.g. hex-decode → xor → stats → randomness) as a single reusable artifact.

The transform ops reuse the toolkit's existing engines (p25crypto for the real ADP/DES/3DES/AES ciphers, voice for spectral inversion, stats and randomness for the analyses), so the pipeline composes the same primitives the standalone tools expose.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func External

func External(op string) bool

External reports whether op shells out to a host program (and so must be refused on the web recipe endpoint). Unknown ops report false.

func Ops

func Ops() []struct {
	Name, Synopsis string
	Transform      bool
}

Ops returns the registered operation names and synopses, sorted (CLI -list).

Types

type OpParam

type OpParam struct {
	Name  string `json:"name"`
	Label string `json:"label"`
	Kind  string `json:"kind"` // hex | int
	Help  string `json:"help,omitempty"`
}

OpParam describes one parameter of an operation, enough for the web recipe builder to render an input control.

type OpSpec

type OpSpec struct {
	Name      string    `json:"name"`
	Synopsis  string    `json:"synopsis"`
	Transform bool      `json:"transform"`
	External  bool      `json:"external,omitempty"`
	Params    []OpParam `json:"params,omitempty"`
}

OpSpec is the full, web-facing description of one operation.

func Specs

func Specs() []OpSpec

Specs returns every operation with its parameters, sorted by name — the source the web recipe builder renders its palette and step forms from.

type Report

type Report struct {
	InputBytes int          `json:"input_bytes"`
	Steps      []StepResult `json:"steps"`
	FinalBytes []byte       `json:"-"`
	FinalHex   string       `json:"final_hex"`
	FinalASCII string       `json:"final_ascii"`
}

Report is the pipeline outcome.

func Run

func Run(input []byte, steps []Step) (*Report, error)

Run executes the steps over input, threading the working buffer through the transforms. A step error aborts the pipeline and is returned with the partial report.

type Step

type Step struct {
	Op     string
	Params map[string]any
}

Step is one recipe operation: an op name plus its parameters.

type StepResult

type StepResult struct {
	Op        string         `json:"op"`
	Transform bool           `json:"transform"`
	BytesIn   int            `json:"bytes_in"`
	BytesOut  int            `json:"bytes_out"`
	Info      map[string]any `json:"info,omitempty"`
	Note      string         `json:"note,omitempty"`
}

StepResult records what one step did.

Jump to

Keyboard shortcuts

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