utils

package
v0.0.0-...-6bf6dc8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: CC0-1.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CrackSingleByteXor

func CrackSingleByteXor(ciphertext []byte) ([]byte, byte, float32)

func EnglishTextScorer

func EnglishTextScorer(text []byte) float32

func FillMatrixFromList

func FillMatrixFromList(data []byte, colCount int) [][]byte

func FindHammingDistance

func FindHammingDistance(a, b []byte) (int, error)

func FindKey

func FindKey(keysize int, data []byte) []byte

func FindNormalisedHammingDistance

func FindNormalisedHammingDistance(a, b []byte) (float32, error)

func ImportB64Data

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

func ImportTxtLines

func ImportTxtLines(filepath string) [][]byte

func RepeatingKeyXor

func RepeatingKeyXor(key, data []byte) []byte

func SingleByteXOR

func SingleByteXOR(key byte, data []byte) []byte

func Transpose

func Transpose(matrix [][]byte) [][]byte

Transpose transposes a 2D byte slice.

func XorBytes

func XorBytes(a, b []byte) ([]byte, error)

Types

type IntFloatPair

type IntFloatPair struct {
	IntValue   int
	FloatValue float32
}

func FindBestKeySizes

func FindBestKeySizes(ciphertext []byte, maxKeySize, samplesPerKeysize int) []IntFloatPair

Jump to

Keyboard shortcuts

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