Alice

Parameters known by Alice:

Computes the public key \( b \):

Receives the ciphertext \( c \):

Computes the decryption key value \( c^{'} \):

Decrypts the ciphertext \( c \):

Converts to the message:

Step y/x

Enter a message (a sentence) or a key (an integer between 0 and 255) 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.

Alice chooses a superincreasing sequence \( w \) such that \( w_{i} > \sum_{j=1}^{i-1} w_{j} \).

She then randomly selects a value \( m \) and computes \( r \) by randomly choosing values until \( \gcd(r, m) = 1 \).

Finally, she uses the extended Euclidean algorithm to compute the inverse \( r^{-1} \).

Alice computes a new sequence \( b \) that is not superincreasing.

This sequence \( b \) becomes her public key, which she sends to Bob.

Before Bob can encrypt the message \( m \), he needs to convert the key to its binary representation.

Bob computes the ciphertext \( c \) by multiplying the \( j \)th bit of \( x \) by the \( j \)th element in the sequence \( b \).

The ciphertext is then the sum of all these multiplications.

He then sends the ciphertext \( c \) to Alice.

Alice computes the value \( c^{'} \), which she needs to decrypt the ciphertext.

Alice uses the sequence \( w \) and the value \( c^{'} \) to decrypt the ciphertext \( c \).

If \( c^{'} \geq w_{i} \), then the \( i \)th bit in the bit string \( x \) is 1 (\\( x_{i} = 1 \\)), and \( c^{'} = c^{'} - w_{i} \).

Otherwise, if \( c^{'} < w_{i} \), then the \( i \)th bit in the bit string \( x \) is 0 (\\( x_{i} = 0 \\)).

Alice converts the binary string to its integer representation.

Bob

Parameters known by Bob:

Receives the public key \( b \).

Converts the message to its binary representation:

Computes the ciphertext \( c \):