util

package
v0.0.0-...-0b52fc4 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESCBCDecrypt

func AESCBCDecrypt(enc, key, iv []byte, unPad bool) []byte

func AESCBCEncrypt

func AESCBCEncrypt(pt, key, iv []byte) []byte

func AESECBDecrypt

func AESECBDecrypt(enc, key []byte) []byte

func AESECBEncrypt

func AESECBEncrypt(pt, key []byte) []byte

func Check

func Check(e error)

func ChunkByteArray

func ChunkByteArray(src []byte, chunksize int, pad bool) [][]byte

Splits bytearray into equally sized chunks

func DetectECB

func DetectECB(inp []byte, size int) (map[string]int, float64)

func FromBase64

func FromBase64(inp string) []byte

func FromHex

func FromHex(inp string) []byte

func HammingDistance

func HammingDistance(orig, new []byte) int

Compare binary hamming distance between two byte arrays

func PKCS7Pad

func PKCS7Pad(block []byte, size int) [][]byte

PKCS#7 Padding Implementation

func RandBytes

func RandBytes(size int) []byte

func ScoreString

func ScoreString(inp []byte) (float64, float64)

Score string based on a chi2 distribution compared to english

func StringEvery

func StringEvery(str string, f func(rune) bool) bool

func ToBase64

func ToBase64(inp []byte) string

func ToHex

func ToHex(inp []byte) string

func UnPKCS7

func UnPKCS7(pt []byte) []byte

func XOR

func XOR(inp, key []byte) []byte

Works for both repeating key and normal

Types

This section is empty.

Jump to

Keyboard shortcuts

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