Worldwide Mathematica Conference • Chicago 199x8

Hill Ciphers: A Linear Algebra Project with Mathematica

ICTCM 12
Burlingame, California
6 November 1999

Murray Eisenberg
Mathematics and Statistics Department
University of Massachusetts, Amherst
murray@math.umass.edu
www.math.umass.edu/~murray

Introduction

Project goals

Students learn mathematics on their own

Learn more linear algebra: scalar field (Subscript[ℤ, m])

Learn more about Mathematica

• Students learning Mathematica throughout the course.
• An "open" system—not a closed application.
• Leverage what student learns now for later.

Why Mathematica?

"Teach the computer": express ideas in terms computer can execute

Could use other CAS or general-purpose programming language

• Mathematica has built-in functions allowing student to concentrate upon the task.
• Need to be able to load packages student cannot read.
• Tedious in programming language not array-oriented.

Originally implemented in APL and, recently, J.

Project barely exploit capabilities of Mathematica (graphics, numerics, symbolics)

Hill ciphers

Hill tutorial

Student reading material

Printed handout—not yet Mathematica notebook!

The project

About

Implementation

Ready-to-use files on web site

http://www.math.umass.edu/~murray/Hill_ciphers/

To change, need source notebooks

Edit notebooks, save as packages, use Encode.

Methods

Generate key matrices on fly

Lookup in database of text strings

({{  HillData,   HillDBase0,   Vdencipher}})

Generalizable setup!

Issues

• Create pacakge "context" only if globals check OK.
• Create symbolic names indirectly

Extensions and modifications

Student writes own functions—or modifies instructor's for real scalar field:

• to do row-reduction and matrix inversion modulo m

• to use euclidean algorithm to find reciprocals modulo m

Could guide student toward discovering Cracking Theorem

Allow non-prime alphabet length

Allow affine transformations, not just linear

Use arbitrary transposition cipher first

Have to detect key matrix size

Frequency analysis when no captured plaintext-ciphertext