if (password == null)
return new PasswordMessage(new byte[0]);
return new PasswordMessage(password.getBytes());
case AuthenticationMD5Password:
try {
AuthenticationMD5Password auth = (AuthenticationMD5Password) message;
byte[] firstmd5 = encrypt(password.getBytes(), user.getBytes());
byte[] finalmd5 = encrypt(firstmd5, 3, auth.getSalt());
return new PasswordMessage(finalmd5);
} catch (Exception e) {
// if I know what I'm doing then we shouldn't be here
return null;
}