Implemented Password Encryption logic