added encryption and decryption helper methods and tests