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 the key (an integer between 1 and 280) that Bob wants to send encrypted to Alice:

Press Enter to generate the parameters. Use the Left and Right arrow keys to navigate between steps.

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

Alice chooses a 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 two values: \( c_{1} \) and \( c_{2} \).

To compute \( c_{1} \), Bob needs a 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 her secret key \( sk = a \). Then, she uses the extended Euclidean algorithm to compute the inverse \( x^{-1} \) of \( x \).

Alice uses \( x^{-1} \) to decrypt the ciphertext she received 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 to their ASCII values:

Encrypts the message \( m \):