Categorygithub.com/clfs/cryptopals
modulepackage
0.0.0-20240724060538-03fc7825b440
Repository: https://github.com/clfs/cryptopals.git
Documentation: pkg.go.dev

# README

cryptopals

Cryptopals solutions in Go.

# Functions

Englishness scores b on how much it resembles English.
FindBlockSize returns the block size used by an encryption oracle.
FindSingleByteXORCiphertext returns the index of the ciphertext most likely to be single-byte XOR encrypted.
Hamming returns the Hamming distance between a and b.
HexToBase64 converts a hex-encoded string to a Base64-encoded string.
IsECBCiphertext returns true if b is likely to be ECB encrypted.
IsECBOracle returns true if an encryption oracle uses ECB mode.
NewAdminProfile performs a cut-and-paste ECB attack to create an admin profile from multiple user profiles.
NewCBCDecrypter returns a cipher.BlockMode which decrypts in cipher block chaining mode.
NewECBDecrypter returns a cipher.BlockMode which decrypts in electronic codebook mode.
NewECBEncrypter returns a cipher.BlockMode which encrypts in electronic codebook mode.
NewECBOrCBCPrefixSuffixOracle returns a new oracle that encrypts inputs as described in challenge 11.
NewECBPrefixSuffixOracle returns an encryption oracle that behaves as described in challenge 14.
NewECBSuffixOracle returns an oracle that encrypts inputs as described in challenge 12.
NewProfileManager returns a new profile manager.
NewRepeatingKeyXORCipher returns a new repeating-key XOR cipher.
NewSingleByteXORCipher returns a new single-byte XOR cipher.
PadPKCS7 returns a new slice that concatenates b with PKCS #7 padding to guarantee block size n.
RecoverECBSuffixOracleSecret takes an encryption oracle that behaves as described in challenge 12 and recovers the secret used.
RecoverRepeatingKeyXORKey returns the most likely key for a repeating-key XOR ciphertext.
RecoverRepeatingKeyXORKeySize returns the most likely key size for a repeating-key XOR ciphertext, within lo to hi inclusive.
RecoverSingleByteXORKey returns the most likely key for a single-byte XOR ciphertext.
UnpadPKCS7 returns a subslice of b with PKCS #7 padding removed.
XOR returns a xor b.

# Structs

ProfileManager manages profiles as described in challenge 13.