updated encryption class with tests.