Fix a buffer overflow in password encryption, and allow arbitrary password length.