Documentation ¶
Overview ¶
Package unsafeaes contains helper functions used in solving the Matasano Cryptopals challenges and is in no way an actual usable set of cryptographic tools
Index ¶
- func DecryptCBC(ciphertext []byte, key []byte) (plaintext []byte, err error)
- func DetectBlockSize(oracle Oracle) (blockSize int, err error)
- func DetectMode(oracle Oracle) (mode string, err error)
- func EncryptCBC(plaintext []byte, key []byte) (ciphertext []byte, err error)
- func EncryptECB(plaintext, key []byte) (ciphertext []byte, err error)
- type Oracle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptCBC ¶
DecryptCBC decrypts a provided ciphertext encrypted with AES-CBC mode using the provided key.
func DetectBlockSize ¶
DetectBlockSize auto detects the block size (up to 1024 bytes) of the ciphertext returned by an oracle
func DetectMode ¶
DetectMode looks for repeating blocks in the output text to try to determine if a provided encryption oracle is using EBC mode or not
since we fed a series of 0's to it, ECB will result in at least 2 consecutive duplicate blocks existing, while CBC will not.
func EncryptCBC ¶
EncryptCBC encrypts the provided plaintext using AES in CBC mode using the provided key
func EncryptECB ¶
EncryptECB encrypts the provided plaintext using AES in EBC mode