Documentation
¶
Index ¶
- func Base64Decode(src []byte) ([]byte, error)
- func BreakRepeatingKeyXOR(b []byte) []byte
- func CBCDecrypt(b []byte, key []byte, iv []byte) []byte
- func CBCEncrypt(b []byte, key []byte, iv []byte) []byte
- func DecryptAESECB(b, key []byte) []byte
- func DetectECB(b []byte) bool
- func DetermineKeysize(b []byte) (int, float64)
- func EncryptAESECB(b, key []byte) []byte
- func HammingDistance(bs ...[]byte) float64
- func HexStringToBase64String(h string) string
- func HexToBase64(src []byte) []byte
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- func PKCS7Pad(b []byte, blockSize int) []byte
- func PKCS7Unpad(b []byte, blockSize int) []byte
- func ScorePlaintext(s string) float64
- func Xor(b1, b2 []byte) []byte
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
Base64Decode decodes a byte array from base64 encoding Seems to be returning too long a slice for s1c6
func CBCDecrypt ¶
CBCDecrypt - Cipher Block Chaining AES decryption likely less efficient than the crypto lib impl
func CBCEncrypt ¶
CBCEncrypt - Cipher Block Chaining AES encryption likely less efficient than the crypto lib impl
func DecryptAESECB ¶
DecryptAESECB decrypts encrypted data b using given key Equivalent in openssl commandline: fmt.Sprintf(openssl enc -aes-128-ecb -a -d -K '%s' -nosalt -in 7.txt", hex.EncodeToString(key))
func DetermineKeysize ¶
DetermineKeysize determines the likely keysize of an encryption cypher given the encrypted data b. It also returns normalised difference of the blocks of size keysize, this can be considered a sort of confidence, the lower the better
func EncryptAESECB ¶
EncryptAESECB encrypts data b using given key
func HammingDistance ¶
func HexStringToBase64String ¶
HexStringToBase64String is a utility function, not intended for heavy use due to string conversions
func HexToBase64 ¶
HexToBase64 takes a hex encoded byte array and returns a base 64 encoded byte array, a function that only operates upon a byte repr is desirable in terms of effiency TODO: This is not hex specific, rename Base64Encode
func PKCS7Pad ¶
PKCS7Pad pads data b upto nearest multiple of blocksize PKCS#7 padding should work for any block size from 1 to 255 bytes
func PKCS7Unpad ¶
PKCS7Unpad strips padding from unencrypted data b
func ScorePlaintext ¶
ScorePlaintext scores a string for confidence that is plaintext, the higher the score, the higher the confidence