added test for the one time pad and refactored the code