# Threshold Encryption Flow
## Encryption Flow
### Input
* Message M
* Eon number i
* System params (MPK, G1, G2)
### Steps
1. Generate random σ (sigma)
2. r = H3(σ, M)
3. C1 = rP2 (where P2 is G2 generator)
4. gt = e(H1(i), MPK)\*r => ([r]e(H1(i), mpk) = [r]e(h(i)\*P1, s\*P2) = [h(i)rs]e(P1, P2))
6. C2 = σ ⊕ H2(gt)
7. Split M into blocks, encrypt each with:
* C3[j] = block[j] ⊕ H4(σ, j)
### Output
Ciphertext (C1, C2, C3)
## Decryption Flow
### Input
* Ciphertext (C1, C2, C3)
* Eon secret key sk = sH1(i)
### Steps
1. Compute gt = e(sk, C1) => (e(sk, C1) = e(h(i)\*s\*P1, r\*P2) = [h(i)rs]e(P1, P2))
2. Recover σ = C2 ⊕ H2(gt)
3. For each block j:
* Compute keyStream = H4(σ, j)
* Decrypt block = C3[j] ⊕ keyStream
4. Concatenate blocks to get M
5. Verify r = H3(σ, M)
* Check if rP2 equals C1