Author: Leslie Horace
Purpose: Dynamically finding hill cipher encryption/decryption key pairs
Version: 1.0
- hillcipher_main.c
- Functions for creating encryption key and computing decryption key
- hillcipher_main.h
- Header file to use functions from "hillcipher_main.c"
- hillcipher_main.c
- simple main to demonstrate hill cipher key pair generation
- Makefile
- compiling program and cleaning out files
make
gcc ./hillcipher_main.c ./hillcipher_keypair.c -o < outfile>
make clean
usage: < outfile> <enc_key filename> <dec_key filename>
output files are written in binary, use (.bin) extension
- Creates a random square key matrix of order n, where n is in range [2, 9]
- The matrix is filled with random codes [0,26] for language [A-Z]
- Keeping the order small for demoing purposes
- Computes the modular inverse by performing elementary row operations
- Row Multiplication
- Row swap
- Row addition
- All computations are reduced (mod 26) for language [A-Z]
- [MODULUS] macro in "hillcipher_key.c" can be modified as needed
- Generates new encryption keys until finding one that is invertible (mod 26)
- Upon finding valid keypair, each key is written to the specified filenames
- The keys can be read back in for use and/or display to the console