> 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/cryptography-introduction.md).

# Cryptography - Introduction

{% hint style="info" %}
Please note that this site is a continuous **work-in-progress!**
{% endhint %}

**Cryptography**, or cryptology, is the practice and study of techniques for [secure communication](https://en.wikipedia.org/wiki/Secure_communication) in the presence of [adversarial](https://en.wikipedia.org/wiki/Adversary_\(cryptography\)) behavior. More generally, cryptography is about constructing and analyzing [protocols](https://en.wikipedia.org/wiki/Communication_protocol) that prevent third parties or the public from reading private messages. Modern cryptography exists at the intersection of the disciplines of mathematics, [computer science](https://en.wikipedia.org/wiki/Computer_science), [information security](https://en.wikipedia.org/wiki/Information_security), [electrical engineering](https://en.wikipedia.org/wiki/Electrical_engineering), [digital signal processing](https://en.wikipedia.org/wiki/Digital_signal_processing), physics, and others. Core concepts related to [information security](https://en.wikipedia.org/wiki/Information_security) ([data confidentiality](https://en.wikipedia.org/wiki/Confidentiality), [data integrity](https://en.wikipedia.org/wiki/Data_integrity), [authentication](https://en.wikipedia.org/wiki/Authentication), and [non-repudiation](https://en.wikipedia.org/wiki/Non-repudiation)) are also central to cryptography. Practical applications of cryptography include [electronic commerce](https://en.wikipedia.org/wiki/Electronic_commerce), [chip-based payment cards](https://en.wikipedia.org/wiki/Smart_card#EMV), [digital currencies](https://en.wikipedia.org/wiki/Digital_currencies), [computer passwords](https://en.wikipedia.org/wiki/Password), and [military communications](https://en.wikipedia.org/wiki/Military_communications).

In [cryptography](https://en.wikipedia.org/wiki/Cryptography), a sending party uses a [cipher](https://en.wikipedia.org/wiki/Cipher) to [encrypt](https://en.wikipedia.org/wiki/Encryption) (transform) a secret [*plaintext*](https://en.wikipedia.org/wiki/Plaintext) into a [*ciphertext*](https://en.wikipedia.org/wiki/Ciphertext), which is sent over an insecure [communication channel](https://en.wikipedia.org/wiki/Communication_channel) to the receiving party. The receiving party uses an inverse cipher to [decrypt](https://en.wikipedia.org/wiki/Decryption) the ciphertext to obtain the plaintext. A secret knowledge is required to apply the inverse cipher to the ciphertext. This secret knowledge is usually a short number or string called a [*key*](https://en.wikipedia.org/wiki/Cryptographic_key). In a [cryptographic attack](https://en.wikipedia.org/wiki/Cryptographic_attack) a third party cryptanalyst analyzes the ciphertext to try to "break" the cipher, to read the plaintext and obtain the key so that future enciphered messages can be read. It is usually assumed that the encryption and decryption algorithms themselves are public knowledge and available to the cryptographer, as this is the case for modern ciphers which are published openly.

## Resources

Cryptanalysis - Wikipedia: <https://en.wikipedia.org/wiki/Cryptanalysis>

Cryptography - Wikipedia: <https://en.wikipedia.org/wiki/Cryptography>

Cryptographic hash function - Wikipedia: <https://en.wikipedia.org/wiki/Cryptographic_hash_function>

Encryption - Wikipedia: <https://en.wikipedia.org/wiki/Encryption>
