> For the complete documentation index, see [llms.txt](https://cajac.gitbook.io/ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cajac.gitbook.io/ctf-notes/crypto/attack-models.md).

# Attack Models

In [cryptanalysis](https://en.wikipedia.org/wiki/Cryptanalysis), attack models or attack types are a classification of [cryptographic attacks](https://en.wikipedia.org/wiki/Cryptographic_attack) specifying the kind of access a [cryptanalyst](https://en.wikipedia.org/wiki/Cryptanalysis) has to a system under attack when attempting to "break" an [encrypted](https://en.wikipedia.org/wiki/Encryption) message (also known as [*ciphertext*](https://en.wikipedia.org/wiki/Ciphertext)) generated by the system. The greater the access the cryptanalyst has to the system, the more useful information they can get to utilize for breaking the cypher.

Some common attack models are:

* **Chosen-ciphertext attack (**[**CCA**](https://en.wikipedia.org/wiki/Chosen-ciphertext_attack)**)**\
  Is an attack model for cryptanalysis where the cryptanalyst can gather information by obtaining the decryptions of chosen ciphertexts.
* **Chosen-plaintext attack (**[**CPA**](https://en.wikipedia.org/wiki/Chosen-plaintext_attack)**)**\
  This attack model presumes that the attacker can obtain the ciphertexts for arbitrary plaintexts.
* **Ciphertext-only attack (**[**COA**](https://en.wikipedia.org/wiki/Ciphertext-only_attack)**)**\
  Is an attack model for cryptanalysis where the attacker is assumed to have access only to a set of ciphertexts.
* **Known-plaintext attack (**[**KPA**](https://en.wikipedia.org/wiki/Known-plaintext_attack)**)**\
  In this type of attack it is assumed that the cryptanalyst has access to at least a limited number of pairs of plaintext and the corresponding enciphered text.

## Resources

Attack model - Wikipedia: <https://en.wikipedia.org/wiki/Attack_model>

Chosen-ciphertext attack - Wikipedia: <https://en.wikipedia.org/wiki/Chosen-ciphertext_attack>

Chosen-plaintext attack - Wikipedia: <https://en.wikipedia.org/wiki/Chosen-plaintext_attack>

Ciphertext-only attack - Wikipedia: <https://en.wikipedia.org/wiki/Ciphertext-only_attack>

Known-plaintext attack - Wikipedia: <https://en.wikipedia.org/wiki/Known-plaintext_attack>
