Alice's Machine

    Please enter a prime number
    Click button above to see list of generators here
    Not a valid generator
    Number should be greater than 0 and less than (p-1)

    \(h\) is calculated as \(h = g^x \ mod \ p\)

    You have no messages.

    Message is decrypted using \[s = c{_1}^x\ mod\ p\] \[m = c{_2}\ .\ s^{-1}\ mod\ p\] which can be rewritten \(\dagger\) as \[m = c{_2}\ .\ s^{p-2}\ mod\ p\] \(\dagger\) See Euler's Theorem

    Alice's Public Key
    --
    Bob's encrypted message
    --

    Bob's Machine

    Should be greater than or equal to 0 and less than p - 1
    Should be greater than 0 and less than p.

    Encrypted message is calculated as \((c{_1}, c{_2}) = (g^r \ mod \ p, (h^r \ mod \ p)m)\)

    References