I'm working on a cryptanalysis project for my professor, and I need some guidance. The assignment involves implementing one of the following types of attacks on a ciphertext encrypted with a symmetric key algorithm:
- Chosen plaintext
- Chosen ciphertext
I've implemented AES with CTR mode, and I’m considering using a chosen plaintext attack. But I don't know how to implement it as I haven't found any practical examples online or in books. Based on theory, I've come up with the following solution:
I send a plaintext of the same length as the ciphertext I want to decrypt to the encryption algorithm.
The resulting ciphertext is XORed with the original plaintext to obtain the keystream.
I can then XOR this keystream with the ciphertext I want to decrypt to get the plaintext.
Unfortunately, I'm not sure if the keystream remains the same for each encryption during a chosen plaintext attack, and I'm not sure if my professor will accept such a solution since the way he described the attacks seemed much more complex. Does this method seem valid for a chosen plaintext attack? Would this be acceptable as a demonstration for my project? Additionally, is there a specific name for this type of attack within the chosen plaintext category? Thank you for any insights or feedback you can provide!