# Is chosen ciphertext attack used to obtain a key? [duplicate]

I don't understand what the goals are of a Chosen Ciphertext Attack. What I've read from Wikipedia is that it is an attack one can use to obtain the key that the crypto algorithm uses.

However, I think that every file is usually encrypted using a different key. If so, why is the chosen ciphertext attack used ? Maybe I don't quite understand the concept of a key...

I'm no mathematician or cryptoanalyst but a simple curious boy :)

• In general, recovery of a key is not the goal, because the key is just a tool for communication; generally the adversary's goal is to eavesdrop on or disrupt the communication. For example, in World War II, nobody fundamentally cared about what positions some soldier's Enigma rotors were in, as long as they could predict where the air raids were going to be and defend against them! – Squeamish Ossifrage Mar 7 '19 at 16:33