Alice

Parameters known by Alice:

Computes \( A \) in the public key:

Receives the ciphertext \( (c_{1}, c_{2}) \)

Computes \( x \) and \( x^{-1} \):

Decrypts the ciphertext:

Step y/x

Enter the message (a sentence) or key (an integer between 1 and 280) that Bob wants to send encrypted to Alice:

Hit enter to generate the parameters and use the left and right arrow keys to navigate.

A trusted third party publish a prime number \( p \) and a generator \( g \) of the group \( \mathbb{Z}_{p}^{*} \).

Alice chooses the secret key \( sk = a \) and computes the public key \( pk = (p, g, A) \) which she sends to Bob.

The ciphertext of the message \( m \) consists of the two values \( c_{1} \) and \( c_{2} \).

To compute \( c_{1} \) Bob needs an random ephemeral key \( k \) that is unique for this encryption.

Before Bob can encrypt the message \( m \) he needs to convert each letter into its corresponding ASCII value.

Bob uses Alice's public key \( pk = (p, g, A) \) to encrypt the message \( m \).

He then sends the ciphertext \( (c_{1}, c_{2}) \) to Alice.

Alice needs the inverse of \( x \) to decrypt the ciphertext \( c_{2} \).

First Alice computes the value of \( x \) using \( c_{1} \) and the secret key \( sk = a \) and then she uses the extended Euclidean algorithm to compute the inverse \( x^{-1} \) of \( x \).

Alice uses \( x^{-1} \) to decrypt the received ciphertext from Bob.

Bob

Parameters known by Bob:

Receives the public key \( pk = (p, g, A) \)

Computes the first value \( c_{1} \) of the ciphertext

Converts the letters into ASCII values:

Encrypts the message \( m \):