Added encrypt function for passwords