implemented password encryption and added tests