Most of these notes are taken while reading Chapter 3 of Introduction to Modern Cryptography and you'll notice that terms, definitions and theorems are directly adapted from the source. It's advised to read the original source than these incomplete notes.
Computational Security: in contrast to Perfect Secrecy, computational security allows for small probability of leaking information and computational limits on the attacker (efficient adversaries).
A scheme is $(t,ϵ)−$secure if an attacker can break the scheme in at most time $t$ with probability at most $ϵ$.
Asymptotic Approach: rather than concretesecurity approach, most cryptographic protocols’ security are defined by security parameter $λ$, and running time of adversary, success probability are functions of security parameter, rather than concrete values.
 Efficient adversaries run in polynomial time $λ$
 $negl(λ)$: refers to the small success probabilities, less than inverse of $λ$.
PPT: probabilistic polynomialtime. Secure scheme: If a PPT adversary succeeds in breaking the scheme with negl probability.
Asymptotic approach
Two things to consider:
 polynomialtime algorithms: any function is polynomially bounded if for any constant $c$, $f(n)<n_{c}$ for all n. an algorithm runs in polynomial time, if for a polynomial $p$ and input $x∈{0,1}_{∗}$, it terminates in $p(∣x∣)$ steps.
 negligible function: a function $f$ is negligible if for every polynomial $p$, there exists $N$ such that for every $n>N$, $f(n)<p(n)1 $, or from the definition of polynomial function, for all constants $c$, there exists $N$ such that for every $n>N$, $f(n)<n_{−c}$.
Cryptographic algorithms are probabilistic (randomised), that’s why attackers are allowed to be probabilistic as well. This gives attackers more powers and allows to model more practical attacks.
probabilistic (randomised) algorithms are one that use randomness in their logic. Normally, randomness is used in the input.
TODO: explain some examples of negligible functions, and why some functions are preferred over other across different range of inputs.
Main importance of negligible functions is that they obey closure properties:
 $negl_{3}(n)=negl_{1}(n)+negl_{2}(n)$ is also negligible.
 $negl_{4}(n)=p(n)⋅negl_{1}(n)$ is also negligible. This means that repeating an experiment that repeats a negligible event any number of times still succeeds with negligible probability.
A scheme is secure if for every PPT adversary $A$, and $∀p∃N$ such that for all $n>N$, the probability of attack's success is less than $p(n)1 $.
Computationally Secure encryption
 Define encryption as $Gen,Enc,Dec$ and model an adversary $A$ with additional power being eavesdropping, i.e. it can look at all the messages as an observer, and the adversary is efficient as explained in previous section.
 Define an indistinguishability experiment $PrivK_{A,Π}$ where $Π$ is a encryption scheme and $A$ is a PPT adversary, in which adversary chooses messages $m_{0},m_{1}$ and receives encryption and has to output a bit $b_{′}$. According to the definition, $Π$ is computationally secure if $Pr[PrivK_{A,Π}(n)=1]≤21 +negl(n)$.
 Define Semantic Security as a slightly weaker notation of Perfect secrecy. Now, define that the notion of indistinguishability is similar to semantic security by two reductions:
 probability of adversary $A$ determining the $i$th bit of message $m$ from $Enc(m)$ is less than $21 +negl(n)$, i.e. it’s same as adversary randomly guessing the bit.
 probability of adversary $A$ determining the function $f$ on $m$, regardless of its distribution $D$, from $Enc(m)$ is equal to adversary $A_{′}$ computing $f(m)$ without knowledge of ciphertext.
 Define Semantic security as probability of determining $f(m)$ from $Enc(m)$ and external knowledge $h(m)$, where $m$ is sampled from PPT algorithm $Samp$, equal to probability of adversary $A_{′}$ computing $f(m)$ from $h(m)$.
 Now, any encryption is EAVsecure iff it is semantically secure in presence of eavesdropper.
Semantically secure encryption

having defined semantic security, we’re now interested in realising a encryption scheme

for that we need randomisation and true random generators are difficult to model computationally, that’s why in cryptography pseudorandom numbers are used.

to construct an EAVsecure encryption scheme using PRG, we need help of reduction proofs.

Reduction Proofs: To prove that problem X is hard, we reduce the notion of security in problem X to already hard problem X’, and prove that if X is solved, this means X’ is solved, this leads to contradiction.
 Model adversary A for X which simulates attack for adversary A’ on X’ which A’ succeed with probability $ϵ(n)$, and outputs directly related to the output of X’ with probability $ϵ(n)/p(n)$.
 Now, if $ϵ(n)$ isn’t negligible, neither is $p(n)ϵ(n) $, this means, A’ can break X’ if A breaks X. but according to our assumption $ϵ(n)$ is negligible.

encryption scheme using prg uses keystream as pad generated by PRG and encryption is done using XOR cipher. This is unconditionally secure if $k$ is truly random by onetime pads (OTP).

To prove it’s EAVsecure, we reduce the problem by introducing a distinguisher $D$ that simulates attack for adversary $A$ on encryption scheme $Π$.

D only succeeds when $A$ succeeds, $Pr[D(G(k))=1]=Pr[PrivK_{A,Π}=1]$

using one time pad, we identify that if encryption is done on a uniform string using one time pad, probability is exactly equal to 1/2

since, G is a PRG, there is a negligible probability of success in distinguishing pseudorandom string to uniform string, this equates to encryption $Π$ directly, and thus, it also has slightly higher probability than 1/2.

define multiple encryption scheme, i.e. eavesdropper shouldn’t be able to distinguish even when same message is encrypted by the scheme.
Chosen plaintext attacks
 multiple encryption indistinguishability refers to probability of adversary to differ between two sets of ciphertexts generated using list of messages chosen by $A$.
 It’s not possible to have multiple encryption indistinguishability if encryption is stateless and deterministic.
 Chosen Plaintext Attack (CPA) security: only difference with EAVsecurity is key is derived before adversary chooses messages, and adversary has access to encryption oracle.
 Encryption oracle $Enc_{k}(⋅)$ can be used by adversary to get ciphertext for any message, and the adversary can interact with oracle as many times as it likes.
 CPA indistinguishability experiment $PrivK_{A,Π}(n)$:
 key is chosen by running $Gen(1_{n})$
 $A$ is given oracle access to $Enc_{k}(⋅)$ chooses messages $m_{0},m_{1}$
 uniform bit $b∈{0,1}$ is chosen and $c←Enc_{k}(m_{b})$ is given to $A$
 adversary outputs bit $b_{′}∈{0,1}$, and succeeds if $b_{′}=b$.
 CPA security: prob. of success is $Pr[PrivK_{A,Π}=1]≤21 +negl(n)$
 CPA security for multiple encryption: $LR_{k,b}(⋅,⋅)$ oracle access is given to $A$, which on input two messages $m_{0},m_{1}$ sends encryption of $m_{b}$ where b is uniform bit chosen at the beginning of experiment
 CPAsecure for multiple encryptions if $Pr[PrivK_{A,Π}=1]≤21 +negl(n)$.
 CPA security for multiple encryption means CPA security for single Encryption
 In fact, encryption that are CPA secure are also CPA secure for multiple encryption. Prove this.
 Above is not true for EAVsecurity, i.e. encryption that are EAVsecure might not be EAVsecure for multiple encryption. Perfect example is onetime pads.
CPA security from PRF
 A CPAsecure encryption function can be formed using any PRF by just XORing the input message with output of PRF where seed for PRF is chosen uniformly. and is padded with encrypted output to form ciphertext, i.e. $c:=⟨r,F_{k}(r)⊕m⟩$, and decrypted by again XORing $m:=F_{k}(r)⊕s$
 To prove this scheme is CPA secure, we need to prove that $Pr[PrivK_{A,Π}=1]≤21 +negl(n)$
 Common template used throughout proving encryption schemes secure, is to first consider hypothetical truerandom variant of the scheme and prove using reduction proofs that adversary doesn’t gain any advantage, and then add pseudorandomness to do probabilistic analysis.
 prove in two steps: first define a distinguisher $D$ that will simulate CPA for adversary $A$, and use it’s output to determine whether encryption oracle $O$ is pseudorandom, i.e. $F_{k}$ or chosen uniformly from $Func_{n}$.
 i.e. Prove $Pr[PrivK_{A,Π}=1]−Pr[PrivK_{A,Π}=1]≤negl(n)$
 Let’s explain how $D$ works. $D$ has access to encryption oracle $O$.
 Setup $A(1_{n})$. $A$ queries $O$ for message $m∈{0,1}_{n}$. Choose a uniform $r∈{0,1}_{n}$ and obtain $⟨r,y⊕m⟩$.
 $A$ chooses challenge messages $m_{0},m_{1}$. $D$ choose uniform bit $b∈{0,1}$ and queries $O(m_{b})$, returns the ciphertext to $A$.
 $A$ continue asking encryption oracle queries until it outputs bit $b_{′}$
 There can be two scenarios:
 When $O_{′}s$ function is pseudorandom, $A_{′}s$ view as a subroutine in $D$ is identical to CPA experiment of a PRF. Thus, $Pr[D_{F_{k}(⋅)}(1_{n})=1]=Pr[PrivK_{A,Π}(n)=1]$
 When $O_{′}s$ function is random function $f$, then $A_{′}s$ view is identical to CPA experiment of random function. Thus, $Pr[D_{f(⋅)}(1_{n})=1]=Pr[PrivK_{A,Π}(n)=1]$
 Thus, by assumption that $F$ is Pseudorandom, we establish that $Pr[PrivK_{A,Π}=1]−Pr[PrivK_{A,Π}=1]≤negl(n)$.
 Next step is to prove that $Pr[PrivK_{A,Π}=1]≤21 +2_{n}q(n) +negl(n)$.
 Left as exercise for future me.
Ciphers and Mode of Operation
Encrypt arbitrary long messages using symmetric encryption primitives. Two of them are:
 Stream Ciphers
 Block Ciphers
Stream Ciphers
 Instantiation of PRNGs using stream ciphers.
 Deterministic algorithms: $Init(s,IV)→st,Next(st)→(y,st_{′})$
 support arbitrary length messages using $GetBits(st,1_{l})$
 a stream cipher without an IV is a PRG.
 stream cipher with an PRG is a PRF, such that $F_{s}(IV)defGetBits(Init(s,IV),1_{l})$
 converse can be also true, i.e. creating stream ciphers using PRF, by concatenating $IV$ with counters.
 Modes of Operation:
 Synchronised mode: stateful mode, doesn’t need an IV
 Unsynchronised mode: stateless mode
CCA security
ChosenCiphertext attack where the adversary makes the receiver decrypt a ciphertext of its own choice and in turn learns something original message m or key k. This is what is meant by secrecy in cryptographic land.
CPA security and Message authentication deal with message integrity where attacker isn’t able to modify the ciphertext, and if it does, receiver will accept with only negligible probability.
Let’s understand some attacks possible when adversary has access to decrypt a ciphertext of it’s choice, and learns something about the original message, sometimes the complete message.
 Padding oracle attack: most of block cipher mode of operation use padding to turn plaintext into multiple of cipher’s block size. Most common padding used is PKCS#7 which appends a byte equal to number of bytes required to turn plaintext into a multiple, that number of times. CBC mode is prone to padding oracle attack, where attacker can learn complete message.
 CAPTCHA: user can learn captcha’s original image by using captcha server as oracle.
$Pr[PrivK_{A,Π}=1]≤21 +negl(n)$CCA indistinguishability experiment $PrivK_{A,Π}(n)$:
 Key $K$ is generated by $Gen(1_{n})$
 $A$ has access to encryption $Enc(⋅)$ and decryption oracle $Dec(⋅)$.
 $A$ outputs pair of messages $m_{0},m_{1}$
 uniform bit $b∈{0,1}$ is chosen and challenge ciphertext $c←Enc_{k}(m_{b})$ is computed and given to $A$
 $A$ continues to submit encryption and decryption queries to the oracle, but can’t submit queries to chosen messages, i.e. $m_{0},m_{1}$.
 $A$ outputs bit $b_{′}∈{0,1}$
 experiment outputs 1 if $b_{′}=b$, else 0
As demonstrated in Padding oracle attack, that any encryption scheme that satisfies CCA security has to be nonmalleable, i.e. any change in the ciphertext shouldn’t directly correspond to change in the plaintext as this allows attacker to gain insights about original message.