Cryptographic Hash Functions from Expander Graphs

In the first term of my Master’s, I took the course CO 685: Mathematics of Public Key Cryptography. This course allowed students to choose between taking a final exam, worth 40%, or doing a project, worth 20% (with assignments making up the remaining percentage).

I chose to do the project rather than the exam, and I believe it was the correct choice. I received 100% on the project. The specification for the project stated:

For your project, you must implement a cryptographic primitive, protocol, attack, or construction, and improve upon available implementations in some (small) way. There are at least two possible ways to do this:

  1. Modify an existing implementation of something to be faster, more efficient, or easier to use.
  2. Implement something on your own from scratch, using a platform and/or language on which the thing you are implementing is not readily available.

I went for option 2. I found the paper Cryptographic Hash Functions from Expander Graphs by Charles, Goren, and Lauter, and saw that only one of the two hash functions had been implemented (in C++), and neither had been made publicly available. For my project I implemented the two hash functions in Sage. The intention was not to improve on timings, since Sage, being built on Python is generally slower than C++. Rather, it was to demonstrate the concepts in the paper in a higher level programming language.

Code is available at the following Github Repo