in src/main/java/com/amazon/photosharing/utils/Security.java [31:51]
public static String getPasswordHash(String p_password, byte[] p_seed) {
byte[] pwd = p_password.getBytes();
byte[] result = new byte[pwd.length+p_seed.length];
for (int i = 0; i<result.length;i++) {
if (i%2 == 0 && i/2<pwd.length) {
result[i] = pwd[i/2];
}
if ((i+1)%2 == 0 && (i+1)/2<p_seed.length) {
result[i] = p_seed[(i+1)/2];
}
}
MessageDigest md = null;
try { md = MessageDigest.getInstance("SHA-256");}
catch (NoSuchAlgorithmException e) {
_logger.error(e.getMessage(), e);
}
return Base64.getEncoder().encodeToString(md.digest(result));
}