The Advanced Encryption Standard (AES) is one of the most popular block encryption algorithms used throughout the world today. Also known as Rijndael, AES was developed by Joan Daemen and Vincent Rijmen.
I created the AES Funtastic application as a project for a graduate studies course in Computer Security (SEIS 720), taught by Dr. Brad Rubin at the University of St. Thomas.
The purpose of this project was to enhance my understanding of the AES algorithm and to provide a platform that other students could use to exercise the algorithm. The algorithm design was heavily influenced by the paper, Advanced Encryption Standard by Example, written by Adam Berent.
As a learning tool, the application is fairly limited in functionality. While key sizes from 128-to-256 bit are fully supported, only a single 16-byte block can be encrypted/decrypted at a time -- basically Electronic Code Book (ECB) mode. You can't use this implementation of the algorithm to encrypt an entire document.
The application does not represent a reference implementation. While I attempted to follow best practices in code design, I valued readability over brevity and performance. The code implementation makes use of several algorithmic shortcuts by leveraging pre-calculated tables instead of performing raw computations. A form of logging is built into the AES functions for testing and analysis purposes.
I implemented proper unit testing wherever possible to validate the AES algorithm functions. It's important to note that the testing isn't exhaustive, and the algorithm could potentially contain some defects. Do not use this algorithm implementation in production without further testing.
The application may be installed on any environment supported by Node.js. Both node and the node package manager (npm) must be installed before building this application. The installation process is really easy and should take less than 10 minutes (even less if you already have Node installed on your machine).
The installation process has 4 steps:
- Install node on your system (if not already installed)
- Clone the project repository to your system
- Install the Compass Sass compiler
- Install required node packages into the project
The easiest way to install node on your platform is via one of the packages at: https://nodejs.org/en/download/
If you are on a Mac and use homebrew, you can install node by typing brew install node.
Once node is installed on your machine, install the Grunt task runner CLI using the command npm install -g grunt-cli. This installs the grunt command globally on your system so that you can run it from any directory. Grunt automates all of the tasks associated with setting up and running the application.
Next, clone the AES Funtastic application by typing git clone https://github.com/jasondbaker/aesproject.git in an appropriate directory location on your machine (i.e., ~/project/). Cloning the project will create a new subdirectory called aesproject within your current working directory.
Next, install the Compass Sass compiler on your system. Compass is a Ruby component, so you need to make sure Ruby is installed on your system (default for Macs). Run the command sudo gem install compass.
Go to the root of the newly cloned directory (cd aesproject) and install the required node packages by typing npm install. It may take a few minutes to download and install the packages. Note, some warning messages may appear during the package installation. Also, you will need to have a C compiler installed (i.e., Xcode, gcc) to install some of the packages such as Compass.
Run grunt serve in the application root directory to build the
application and launch a server on port 9000. A web browser session should automatically open pointing to the web root directory at this port address. Javascript must be enabled in the web browser to run this application properly.
Kill the running grunt process (typically ctrl-c in the terminal) to quit the application.
Executing grunt test in the application root directory will run the unit tests with karma.
The application works well today, but could be improved by adding the following features:
- Better input sanitization and error handling
- Mode support to allow for file encryption
- More detailed logging
This software is licensed under the MIT License, and Copyright © 2015 Jason Baker.
