Disable the padding in the encryption process.
- Use the
EVP_CIPHER_CTX_set_padding(ctx, 0);function to disable padding. - Surround the instruction with
CRYPTO25{}to obtain the flag.
Refer to the enc1.c file for the implementation details.
Decrypt a Base64 encoded message using the specified key and IV.
- Decode the Base64 encoded message.
- Use the
EVP_CipherInitfunction to initialize the decryption operation. - Decrypt the ciphertext and print the decrypted text as the flag.
Refer to the decryption.c file for the implementation details.
Encrypt the content of a file using a user-selected algorithm.
- Read the input file, key, IV, output file, and algorithm from the command line.
- Use the
EVP_get_cipherbynamefunction to get the cipher by name. - Encrypt the file content using the specified algorithm.
- Print the flag as
CRYPTO25{EVP_get_cipherbyname}.
Refer to the encryption.c file for the implementation details.
Decrypt a Base64 encoded string using the specified key and IV.
- Decode the Base64 encoded string.
- Try different algorithms to decrypt the ciphertext.
- Check if the decrypted content is valid ASCII text.
- Print the flag as
CRYPTO25{decryptedcontentalgorithm_name}.
Refer to the decryption.c file for the implementation details.