primitive

package
v0.0.0-...-9b8f946 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float64Outliers

func Float64Outliers(input []float64) []float64

float64Outliers given a slice of float64 values will return those which are the highest number of standard deviations from the mean, sort of.

func GuessBlockSize

func GuessBlockSize(a []byte) int

GuessBlockSize use HammingDistance to guess locksize

func HammingDistance

func HammingDistance(a, b []byte) int

HammingDistance the distance between a and b. xor then pop count.

func MaxInt

func MaxInt(a, b int) int

maxInt given int a and b, returns the maximum of the two

func MinInt

func MinInt(a, b int) int

minInt given int a and b, returns the minimum of the two

func SingleXorBrute

func SingleXorBrute(input []byte, depth int) (byte, []byte)

SingleXorBrute is a convience wrapper around SingleXorTop

func SingleXorTop

func SingleXorTop(input []byte, depth int) []byte

SingleXorTop returns the top candidate decrypt xor keys, assuming english text.

func ToBlocks

func ToBlocks(input []byte, bs int) [][]byte

ToBlocks splits a slice into an array of equal sized slices last block will include any data send beyond block size boundary

func Xor

func Xor(a, b []byte) []byte

Xor two byte slices, a and b, wrapping as required to longest length, returning the result as a newly created byte slice.

func XorBrute

func XorBrute(a []byte) ([]byte, []byte)

XorBrute attempt to bruteforce 'a', a byte slice of english text xor'd against another byte slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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