I am storing user encrypted password in database.
code :
String username = "admin";
String encrypted_password = createPassword("admin$321");
// $shiro1$SHA-256$500000$mAXboFyyOtBVoGi6AD8LXw==$acHoVyuQyOSOKfjqwAHXyEVTH7p9cH79yI+0O15NS0U=
System.out.println(getOriginalPassword(encrypted_password));
private static String createPassword(String password) {
DefaultPasswordService passwordService = new DefaultPasswordService();
DefaultHashService hashService = new DefaultHashService();
hashService.setHashIterations(passwordService.DEFAULT_HASH_ITERATIONS);
hashService.setHashAlgorithmName(passwordService.DEFAULT_HASH_ALGORITHM);
hashService.setGeneratePublicSalt(true);
passwordService.setHashService(hashService);
String encryptedPassword = passwordService.encryptPassword(password);
System.out.println(encryptedPassword);
return encryptedPassword;
}
private static String getOriginalPassword(String encrypted_password) {
return null;
}
how to decrypt stored password..?