-
encrypt-auth-chkcontainsmain.goprogram to perform AES encryption in CTR mode with HMAC. Here the AES function is used from the standard package, but the CTR mode encryption and checksum calculations are performed in program.The checksum works as follows:
On input a message M, first parse M into a sequence of octets M1, . . . , Mn. Then checksum
T = sum(M_i mod 256) for i= 1 to n
To build the binary, the following command can be performed:
go buildThe encryption/decryption can be performed with the following command:
./encrypt <mode> -k <16-byte key in hexadecimal> -i <input file> -o <output file>mode =
encryptordecrypt -
decrypt-test-chkcontainsmain.goprogram that works like the oracle. The program./decrypt-test-chkthat has the key K hardcoded into it. It performs decryption of the provided cipher text and it will not return the decrypted ciphertext, but instead only a single one of the following three response messages:- “SUCCESS”
- “INVALID MAC”
The command-line profile for decrypt-test will be as follows:
./decrypt-test-chk -i <ciphertext file> -
decrypt-attack-chkcontainsmain.goprogram that performs the padding oracle attack. The program takes a cipher text as the input programmatically decrypts and returns the plain text of any ciphertext produced by your encryption utility fromencrypt-auth-chkwith the help of./decrypt-test-chk. It will not have access to a decrypt-key. The command-line profile for decrypt-test will be as follows:./decrypt-attack-chk -i <ciphertext file>
-
encrypt-auth-crccontainsmain.goprogram to perform AES encryption in CTR mode with HMAC. Here the AES and CRC32 function is used from the standard package, but the CTR mode encryption calculation is performed in program.To build the binary, the following command can be performed:
go buildThe encryption/decryption can be performed with the following command:
./encrypt <mode> -k <16-byte key in hexadecimal> -i <input file> -o <output file>mode =
encryptordecrypt -
decrypt-test-crccontainsmain.goprogram that works like the oracle. The program./decrypt-test-crcthat has the key K hardcoded into it. It performs decryption of the provided cipher text and it will not return the decrypted ciphertext, but instead only a single one of the following three response messages:- “SUCCESS”
- “INVALID MAC”
The command-line profile for decrypt-test will be as follows:
./decrypt-test-crc -i <ciphertext file> -
decrypt-attack-crccontainsmain.goprogram that performs the padding oracle attack. The program takes a cipher text as the input programmatically decrypts and returns the plain text of any ciphertext produced by your encryption utility fromencrypt-auth-crcwith the help of./decrypt-test-crc. It will not have access to a decrypt-key. The command-line profile for decrypt-test will be as follows:./decrypt-attack-crc -i <ciphertext file>