||5 years ago|
|affine||5 years ago|
|caesar||5 years ago|
|enigma||5 years ago|
|mod||5 years ago|
|moscow||5 years ago|
|primes||5 years ago|
|puzzles||5 years ago|
|.gitignore||5 years ago|
|LICENSE||5 years ago|
|README.md||5 years ago|
Code for doing cryptography in Java.
Crypto Math Classes
Crypto Math: Modular Arithmetic
The Modular Arithmetic class is a static class with methods useful in doing modular arithmetic. These include finding gcds, factoring modulo a number, computing exponents, finding inverses, etc.
- extendedEuclidian(xy, a, b)
Cipher Implementation: Caesar Cipher
The Caesar class implements the Caesar cipher, which is a simple rotation (ROT) cipher with a key between 0 and 25.
Cipher Implementation: Affine Cipher
The Affine class implements the Affine cipher, which implements both a multiplicative and an additive shift. The key has two parts.
If the letters are indexed from 0 to 25, they are shifted according to the formula: formula:
a x + b (mod 26)
where a is the first part of the key and b is the second part of the key. This requires that gcd(a,26) = 1.