package io.github.tombom4.userManagement;

/**
 * Created by Sebastian on 21.01.2016.
 */
public class Password {
    private String encryptedPassword = "";

    public Password(String password){
        encryptPassword(password);
    }

    public static Password byEncryptedPassword(String password) {
        Password psw = new Password("");
        psw.setEncryptedPassword(password);
        return psw;
    }

    public void encryptPassword(String psw){
        char[] passwordChars = psw.toCharArray();
        int[] passwordCode = new int[passwordChars.length];
        long[] passwordCodeEncrypted = new long[passwordChars.length];
        for(int i = 0; i < passwordChars.length; i++){
            passwordCode[i] = passwordChars[i];
            passwordCodeEncrypted[i] = passwordCode[i] * passwordCode[i] * passwordCode[1] * 89222;
            encryptedPassword = encryptedPassword + passwordCodeEncrypted[i];
        }
    }

    public String toString() {
        return encryptedPassword;
    }

    private void setEncryptedPassword(String password) {
        encryptedPassword = password;
    }
}

@@ -147,13 +147,8 @@
 word
- = %22%22
 ;%0A%0A 
@@ -729,24 +729,62 @@
 rdChars%5Bi%5D;%0A
+            if(i == 0 %7C%7C i == 1)%7B%0A    
             
@@ -863,20 +863,286 @@
 ode%5B
-1%5D * 89222;%0A
+i%5D * 892222;%0A            %7Delse %7B%0A                passwordCodeEncrypted%5Bi%5D = passwordCode%5Bi%5D * passwordCode%5B0%5D * passwordCode%5B1%5D * 89222;%0A            %7D%0A%0A            if(i == 0)%7B%0A                encryptedPassword = String.valueOf(passwordCodeEncrypted%5Bi%5D);%0A            %7Delse %7B%0A    
     
@@ -1211,24 +1211,38 @@
 crypted%5Bi%5D;%0A
+            %7D%0A
         %7D%0A  

fix issue "Problem with Password encryption"