set1

package
v0.0.0-...-b103c14 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BreakRepeatingXOR

func BreakRepeatingXOR(input []byte) ([][]byte, error)

BreakRepeatingXOR returns the top keys for the given input. The input is expected to be encrypted using the 'repeating-key XOR'

func DecryptAES128ECB

func DecryptAES128ECB(data, key []byte) ([]byte, error)

DecryptAES128ECB decrypts the data encoded with AES128 in ECB.

func DecryptXOR

func DecryptXOR(cipher []byte) [][]byte

func DetectAES128ECB

func DetectAES128ECB(ciphers [][]byte) int

DetectAES128ECB detects if some cipher was encoded using aes 128 ecb. If found returns the index of the ciper, -1 otherwise.

func DetectXORCipher

func DetectXORCipher(ciphers [][]byte) [][]byte

func EncryptRXOR

func EncryptRXOR(msg, key []byte) error

func FindKeySizes

func FindKeySizes(from, to int, input []byte) ([]int, error)

FindKeySize tries keysizes from the given range. Returns all keysizes sorted from the best score to the lowest score.

func FixedXor

func FixedXor(upper []byte, lower []byte) ([]byte, error)

func HammingDistance

func HammingDistance(first, second []byte) (uint64, error)

HammingDistance returns the number of different bits of the two byte slices. Returns an error if their lengths don't match.

func HexToBase64

func HexToBase64(b []byte) []byte

HexToBase64 converts the bytes b in hex to base64.

Types

type XORDecrypt

type XORDecrypt struct {
	TotalScore   float64
	DecryptedMsg []byte
	Code         int
}

func DecryptXORKey

func DecryptXORKey(cipher []byte) []XORDecrypt

Jump to

Keyboard shortcuts

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