Some Code pieces to download
-
Vigenere ciphers.
compile with:  
cc -o vigenere_solve vigenere_solve.c -lm
Run with:    vigenere_solve ciphertextfile
-
Extended euclidean Algorithm.
compile with:
   cc  ; -o euclidean euclidean.c -lm
Run with:    euclidean  -a12345  -b6789
    
to get d = gcd(12345,6789).
Adding the -e option to the command line gives the extended Euclidean Algorithm
and adding the -v option gives full step-by-step output.
Example:
  
euclidean -a12345 -b6789 -e -v
-
Chinese Remainder Theorem.
Solves the system of congruences:
    x = ai (mod ni)
   i = 1, ... k    
- assumes gcd(ni,nj) = 1    for i not j
compile with:    cc  -o crt  crt.c
Run with: 
Reads the values ai and ni from the command line:
crt  -a[a1,a2,....,ak]  -n[n1,n2,....,nk]
The syntax is critical; each value of a and n must be contained
within the opening and closing square parenthesis [ ],
be separated by a comma and with no spaces.
Example:
   
crt  -a[1,2,3]  -n[4,5,6]
   
solves the congruences
   
   
    x = 1 (mod 4),
    x = 2 (mod 5),
    x = 3 (mod 6)
-
Solving linear congruences.
compile with:    cc  -o solve_congruence  solve_congruence.c
Run with:   
solve_congruence  -a(num)  -b(num)  -n(num)
    to get the solution(s) of
   a x = b (mod n).
Example:   
solve_congruence  -a5  -b10  -n25
    to get solutions x of:
   5 x = 10 (mod 25).
-
Modular Exponentiations.
compile with:    cc  -o mod_exp  mod_exp.c
Run with:   
mod_exp  -y(num)  -x(num)  -n(num)
    to get
   yx  (mod n).
Example:   
mod_exp  -y123  -x456  -n789
    to get
   123456  (mod 789).
-
Calculating the Jacobi symbol.
compile with:    cc  -o jacobi  jacobi.c
Run with:   
jacobi  -a(num)  -n(num)
Example:   
jacobi  -a123  -n456     to get Jacobi (123/456).
-
Calculating continued fractions.
compile with:    cc  -o cont_frac  cont_frac.c
Run with:   
cont_frac  -x(decimal)  -n(num)
    to get the nth term continued fraction
representation to the decimal x.
Example:   
cont_frac  -x3.1415926536  -n4     to get
the 4 term continued fraction for π.