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)

    hh is calculated as h=gx mod ph = g^x \ mod \ p

    You have no messages.

    Message is decrypted using s=c1x mod ps = c{_1}^x\ mod\ p m=c2 . s1 mod pm = c{_2}\ .\ s^{-1}\ mod\ p which can be rewritten \dagger as m=c2 . sp2 mod pm = 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 (c1,c2)=(gr mod p,(hrm) mod p)(c{_1}, c{_2}) = (g^r \ mod \ p, (h^r m)\ mod \ p)

    References