Set up the cipher (done by a central agency or the recipient of messages)

Choose a large prime p for the modulus.

p =Prime[1000000000]

Choose b, a primitive root modulo the prime.

b=PrimitiveRoot[p]

Choose a random large integer, l, for the secret decryption exponent.

ell = 23984726

Compute the power of the primitive root: c=(b^l).

c=Mod[b^ell, p]

Publish: p,b,c.

Encryption (done by anyone who wants to send messages to the recipient)

Choose a plaintext message that has half the number of characters as the number of digits of p.  (Could skip this step and just have your plaintext be an integer x.)

plaintext ="hello"

Encode plaintext as an integer x.

ToCharacterCode[plaintext]-97

x=0704111114

Choose a random large integer, r, for the secret encryption exponent.

r = 569821

Compute the header h=(b^r).

h=Mod[b^r, p]

Encrypt y=(x·(c^r)) %p.

y=Mod[x*c^r,p]

Send header and encrypted message, (h,y), to the intended recipient, who has the decryption key.

Decryption (done by the recipient)

Decrypt using the information received, namely (h,y), and the secret decryption key, l.  The formula for decryption is D(y)=((((h^l)))^(-1))·y  %p.

Dy=Mod[PowerMod[h^ell,-1,p]*y,p]

Check that this is the same as the encoded plaintext, x.

x==Dy

If you chose an English plaintext you can recover it.

FromCharacterCode[{7,4,11,11,14}+97]