String plainTextPwd = user.getPassword();
String cryptedPwd;
//If the password is NOT encrypted, then encrypt it.
if (!pwdCrypted) {
try {
cryptedPwd = new CryptedSimpleCredentials(new SimpleCredentials(user.getScreenname(), plainTextPwd.toCharArray())).getPassword();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return false;
} catch (UnsupportedEncodingException e) {
e.printStackTrace();