TODO:

- Probabilistic encryption
- GM82
- El-gamal
- Pailier

- trapdoor permutation
- [ ]

Public Key encryption scheme: $Gen,Enc,Dec$:

- $Gen(1_{n})→(sk,pk)$: public key defines the message space $M_{pk}$
- $Enc(sk,m)→c$: takes secret key and message $m∈M_{pk}$ and outputs a ciphertext $c$.
- $Dec(pk,c)→m$

### CPA security

eavesdropping indistinguishability experiment $PubK_{A,Π}(n)$:

- $Gen(1_{n})→sk,pk$
- $A$ is given pk, outputs a pair of messages $m_{0},m_{1}$
- uniform bit $b$ is chosen and challenge ciphertext $c←Enc_{sk}(m_{b})$ is given to $A$.
- $A$ outputs bit b’.
- experiment succeeds if $b_{′}=b$ and outputs 1.

$Pr[PubK_{A,Π}=1]≤21 +negl(n)$

No Deterministic public-key encryption is CPA-secure.

Proven in GM82, that any information that a adversary is able to gain about plaintext from ciphertext, it can gain that knowledge without ciphertext. Thus, any protocol designed on deterministic PK encryption is insecure. This includes, RSA without padding, block ciphers without IV.

TODO, read the paper in more detail.

CPA security for multiple encryption:

Prove that any CPA secure PK encryption scheme is also secure for multiple encryptions (adversary is given access to LR oracle $LR_{pk,b}(⋅,⋅)$ that encrypts left or right message depending on the bit).

Informal proof using reduction approach:

- Create a new experiment $LR-cpa2$, that allows maximum 2 oracle queries.
- $A$ selects two sets of message pairs: $m_{1,0},m_{1,1}$ and $m_{2,0},m_{2,1}$, and gets back ciphertext $c_{1},c_{2}$ that can be either equal to $m_{1,0},m_{2,0}$ or $m_{1,1},m_{2,1}$ from oracle, and need to differentiate between the two.
- Let $C_{0}$ denote distribution of messages in first pair, and $C_{1}$ denote second pair.
- Prove: $Pr[A(pk,m_{1,0},m_{2,0})=1]−Pr[A(pk,m_{2,0},m_{2,1})=1]≤negl(n)$.
- Create a new adversary $A_{′}$ that simulates oracle for $A$, but fixes first message, i.e. $A$ receives either $m_{1,0},m_{2,0}$ or $m_{1,0},m_{2,1}$. Let this distribution be denoted as $C_{01}$
- If $A$ can distinguish between $C_{0},C_{01}$, then it can distinguish between $C_{01},C_{1}$. By simple linear algebra, it can distinguish between $C_{0},C_{1}$.
- Due to CPA security of $Π$, view of $A$ running as a subroutine by $A$ will be equal to that of $PubK_{A,Π}$. So, if $A_{′}$ is able to distinguish between, $m_{2,0},m_{2,1}$ due to $A$, then it will break CPA security. Since, this probability is negligible, $A$ can’t distinguish.

Formal proof using hybrid argument approach:

- TODO: need to read more about hybrid argument approach, but the experiment is again choosing an adversary $A_{′}$ that is able to break CPA security of $Π$ if $A$ outputs correct bit.
- let $t$ be the maximum oracle queries $A$ can make, and t is polynomially bounded.
- $A_{′}$ chooses a random index: $1≤i≤t$.
- For jth encrpytion:
- if j<i, then send $c_{j}←Enc(m_{j,0})$, else if $j>i⟹Enc(m_{j,1})$
- if j=i, then output $m_{i,0},m_{i,1}$, receive challenge ciphertext $c$, send to $A$

- $A_{′}$ outputs $b_{′}$ by $A$. experiment succeeds if $b_{′}=b$.
- Now, using a hybrid argument prove that probability of $Pr[A_{′}(⋅)=1]=21 ⋅Pr[A_{′}(⋅)=1∣b=0]+21 ⋅Pr[A_{′}(⋅)=1∣b=1]$

### CCA security

analogous to CCA security for CCA security, in PK encryption, adversary gets access to a decryption oracle and can query any ciphertext other than the challenge ciphertext. It can be proven that any PK encryption that’s CCA secure for single encryption is CCA secure for multiple encryption as well.

Examples where CCA encryption is needed:

- In a private auction, where an adversary can look at other bids as ciphertext, and instead send ciphertext $c_{′}=Enc(m+1)$. This property is known as
*malleability*. - modifying an encrypted message $c:=Enc(m)→c_{′}$. If it receives any error, or a response quoting $m_{′}$, then $A$ has now decrypted c’.

## KEM

set of algorithms:

- $Gen(1_{n})→(pk,sk)$
- $Encaps_{pk}(1_{n})→(c,k)$: gives a uniform key $∈{0,1}_{n}$
- $Decaps_{sk}(c)→k$

can be combined with a private key encryption to create a hybrid encryption scheme: $Π_{hy}:Π_{KEM},Π_{′}$:

- $Gen(1_{n})→(sk,pk)$
- $Enc_{pk}(m)→(c,c_{′})$: $(c,k)←Encaps_{pk}(1_{n})$, and $c_{′}←Enc_{k}(m)$
- $Dec_{′}(c,c_{′})→m$: $Decaps_{sk}(c)→k;Dec_{k}(c_{′})→m$.

security

If KEM is CPA secure, and $Π$ is EAV-secure, then $Π_{′}$ is CPA secure PK encryption scheme.

Proof: TODO

If KEM is CCA secure, and $Π$ is CCA secure, then $Π_{′}$ is CCA secure encryption scheme.

CCA security for KEM: $Pr[KEM_{A,Π}(n)]$:

- $Gen(1_{n})→(pk,sk);Encaps(1_{n})→(c,k∈{0,1}_{n})$
- $b∈{0,1}$ is chosen, if $b=0⟹k^=k$ else $k^∈{0,1}_{n}$
- $A$ is given $(pk,c,k^)$, and access to $Decaps_{sk}(⋅)$ oracle, but can’t query decaps for challenge ciphertext $c$ itself.
- $A→b_{′}∈{0,1}$, if $b=b$ output 1, else 0.

$Pr[KEM_{A,Π}(n)=1]≤21 +negl(n)$.

- If $Π_{′}$ is not CCA secure then, adversary can just modify ciphertext c’, as $c_{′}⊕m_{′}$.
- For $Π_{KEM}$ to be CCA secure, give $A$ access to decaps oracle which allows it to decapsulate any ciphertext and get key of its choice.

### ElGamal KEM

- $Gen(1_{n})→(pk,sk)$: Choose $G,g,q$, then choose a uniform $x∈Z_{q}$, set $h:=g_{x}$. Specify a function $H:G→{0,1}_{l(n)}$. Outputs $pk=(G,g,q,h,H),sk=(G,g,q,x)$.
- $Encaps(pk)$: choose a $y∈Z_{q}$, output $c=g_{y}$ and calculate $k=H(h_{y}))$
- $Decaps(sk,(c,k))$: compute key as $k:=H(c_{x})$.

Above model is CPA secure, if DDH problem is hard.

### CDH based KEM in ROM

If $H$ is modelled as a random oracle, then above KEM is CPA secure, if CDH problem is hard.

CDH is a stronger security assumption that deals with

extractability, i.e. adversary has to find out $h_{y}$.

### CCA security for Hybrid encryption

Gap-CDH assumption

For any adversary, it remains infeasible to compute $g_{xy}$ even when given access to a oracle $O_{y}(U,V)$ that returns 1 only when $V=U_{y}$. Informally, CDH problems remains hard even when an oracle that solved DDH is given.

ElGamal KEM as stated above is CCA secure if the Gap-CDH assumption is hard.

Thus, to create a CCA secure hybrid encryption, one needs to use a CCA private-key encryption scheme. Alternatively, a CPA secure encryption scheme, and CPA secure MAC leads to a CCA secure PK scheme.