Documentation ¶
Index ¶
- func Base64Encode(data []byte) string
- func DecodeHexString(hexStr string) ([]byte, error)
- func GetHammingDistance(str1, str2 []byte) uint64
- func GetMin(a, b int) int
- func GetNrandBytes(n uint) ([]byte, error)
- func GetPkcs7Padded(input []byte, blockLength int) []byte
- func GetPkcs7Unpadded(input []byte, blockLength int) []byte
- func GetSingleByteXor(data []byte) (byte, error)
- func IsAlpha(data []byte) bool
- func Memset(buff []byte, v byte)
- func SingleByteXor(data []byte) ([]byte, error)
- func SumFrequencies(data []byte) float64
- func XorBytes(data, key []byte) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Encode ¶
Base64Encode is a base64 wrapper to encode `data`
func DecodeHexString ¶
DecodeHexString decodes `hexStr` hex encoded string, ex: `4141` -> [65 65]
func GetHammingDistance ¶
GetHammingDistance compute Hamming distance between 2 strings at bit level Example: `this is a test` and `wokka wokka!!!` has `37` as Hamming distance https://en.wikipedia.org/wiki/Hamming_distance
func GetNrandBytes ¶
func GetPkcs7Padded ¶
func GetPkcs7Unpadded ¶
func GetSingleByteXor ¶
GetSingleByteXor attempts to obtain the single by XOR key Encrypted buffer is in `data`. Key is determined base on the heuristic that the original buffer is an english plaintext.
func SingleByteXor ¶
func SumFrequencies ¶
SumFrequencies sums letter frequencies for bytes in [A..Z ] https://en.wikipedia.org/wiki/Letter_frequency
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.