Code for doing crypto-stuff in Java.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Charles Reid 4579b198b0 Adding FULL Combos, new Plugboard, and need-to-revisit Rotors. 7 years ago
affine Adding several affine programs 7 years ago
caesar updating puzzle levels 7 years ago
enigma Adding FULL Combos, new Plugboard, and need-to-revisit Rotors. 7 years ago
mod dividing up scripts into relevant categories. 8 years ago
moscow dividing up scripts into relevant categories. 8 years ago
primes adding print primes 7 years ago
puzzles updating puzzles 7 years ago
.gitignore Initial commit 8 years ago
LICENSE Initial commit 8 years ago
README.md initial commit of files 8 years ago

README.md

java-crypto

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.

  • gcd(a,b)
  • extendedEuclidian(xy[], a, b)
  • solve(a,c,n)
  • inverseMod(a,n)

Cipher Implementations:

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.