# Encryption

A process of converting the original representation of the information (plaintext) into an alternative form (ciphertext). Ideally, only authorized parties can decipher a ciphertext back to plaintext and access the original information.

An encryption algorithm comprises

- a method for encrypting data
- a method for decrypting data
- a secret key used in the decryption/encryption method

The two types of encryption are

- Asymmetric Key Cryptography (sometimes called public-key cryptography)
- Symmetric Key Cryptography

Trapdoor: a mathematical function that is easy to go one way but hard to go the other way (an effectively one-way function)

- Common functions include RSA (prime factorization) and ECC
- RSA for example, is a trapdoor because multiplying primes is easy but factoring the result back into its component primes is hard.
- The bigger the spread between the difficulty of going one direction in a Trapdoor Function and going the other, the more secure a cryptographic system based on it will be

Language

- $A$: Alice
- $B$: Bob
- $K_A$: Alice’s encryption key
- $K_B$: Bob’s decryption key
- $m$: plaintext message
- $K_A(m)$: ciphertext, encrypted with key $K_A$
- $K_B(K_A(m)) = m$

Types of attacks

- Ciphertext-only attack: knowns $K_A(m)$ but not $m$
- Known-plaintext attack: for some $m$ knows $K_A(m)$
- Chosen-plaintext attack: knows $K_A$ but not $K_B$