Code for CO487 (crypto course) assignment.