added missing crypto functionality (some test cases still need work)