Skip to content

Commit

Permalink
ELGamalre (#75)
Browse files Browse the repository at this point in the history
* ELGamalre

* revised

---------

Co-authored-by: user <[email protected]>
  • Loading branch information
abell1689neo and user authored Dec 6, 2024
1 parent 1da0233 commit 79e20e2
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion content/Basic Cryptography/ElGamal.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
The ElGamal system utilizes the [Discrete Logarithm Problem].
The ElGamal system utilizes the [Discrete Logarithm Problem](../Basic%20Algebra/Discrete%20logarithm%20problem.md) as its primal measure obtain security.
[Diffie-Hellman](./Diffie-Hellman.md) is used as fundamental, and is converted into public key encryption to embody ElGamal system.


## Basic Setting
![[ElGamal.png]]
$\mathcal{E}' = (\text{Gen}', \text{Enc}', \text{Dec}')$ is a private-key encryption with $K = G$

- Bob computes $k = u^y$ and encrypts $m$ using the private-key encryption $\mathcal{E}'$.
Resulting ciphertext is $c= (v,c')$
- Alice computes $k= v^x$ and derives $m$ by decrypting $c'$


### Key Generation in ElGamal Encryption:
Computed by Alice (reciever)
- A large prime number $x$ is selected from group $Z_q$ as a private(secret) key, and public key $u = g^x$ is made public
- can be represented as equation below
$\text{Gen}: sk=x \leftarrow \mathbb{Z}_q$ and $pk = u \leftarrow g^x$

### Encryption Process of Message m:
Computed by Bob (encryptor)
- random number $y \leftarrow \mathbb{Z}_q$ is chosen
- $v = g^y$, $k=u^y$ is computed, using public key generated by Alice(reciever)
- encryption is done by computing $c' \leftarrow \text{Enc}'_k(m)$, which is a private key encrytion of message m, via key $k$
- output $c=(v,c')$ as a final ciphertext

### Decryption Process:
- utilizes private key $x$ to compute $k=v^x$ (shared key generated by Bob)
- using shared key $k$ obtained above, ciphertext $c$ can be transfromed into the original plaintext $m$ through $m \leftarrow \text{Dec}'_k(c')$

In RSA, encrypting the same message always produces the same ciphertext, whereas the ElGamal system uses random numbers, resulting in different ciphertexts for the same message each time it is encrypted. Therefore, RSA-OAEP is used in commercial systems. Additionally, the ElGamal system offers security with smaller private key sizes compared to RSA.

## Security of ElGamal
let $\mathcal{E}' = (\text{Gen}', \text{Enc}', \text{Dec}')$ be a private key encryption with $K = G$.
If $\mathcal{E}'$ is CPA-secure and the DDH assumption holds, the ElGamal is CPA-secure.


Key Generation in ElGamal Encryption:

Expand Down
Binary file added content/Basic Cryptography/images/ElGamal(1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 79e20e2

Please sign in to comment.