Ported crypto code to python 3.
Expanded the tests for the crypto code.