Maple Worksheets for some of the basic encryption schemes
- Discrete square roots and Rabin's method.
  
Rabin code.
 
(This currently contains the values for one of the problem sets.)
- RSA.
 
rsa.mws .
 
This code contains the successive square algorithm for computing
yx (mod n) which might be useful in its own right.
This is just the implementation of mod_exp.c
converted to Maple syntax.
There is also an implementation of some of the standard attacks
on RSA - small d and weak prime p,
 
rsa_attacks.mws .
For the common modulus problem, see
here.
- Primality testing.
  
primality.mws.
 
This contains Maple code for three of the probabilistic tests:
Fermat, Solovay-Strassen and Miller-Rabin.
- Discrete Logarithms.
  
The Pöhlig-Hellman algorithm.
for computing discrete logarithms and code to implement the
ElGamal public key cryptosystem.
There is also code for
digital signatures using this scheme,
which includes a very risky implementation.
- Secret Sharing .
A worksheet that implements
Shamir's method for (p,n) sharing.