Simple crypto functions for math based crypto class