I want to use bcrypt to hash the app password. But I could not get the result about use that in android java. How can I use bcrypt hashing in android?
Asked
Active
Viewed 8,031 times
2
-
2https://stackoverflow.com/questions/7626914/using-jbcrypt-to-salt-passwords-in-android-app-causes-a-long-hang – CommonsWare Feb 09 '19 at 19:03
-
thank u @CommonsWare – Hasan Cheraghi Feb 09 '19 at 19:10
1 Answers
0
There is a Java implementation of the BCrypt algorithm here, I even use a modified version of it in my BCryptGenerator project.
Usage of the BCrypt class is as follows:
import com.whatever-domain.BCrypt
private String generateHashedPass(String pass) {
// hash a plaintext password using the typical log rounds (10)
return BCrypt.hashpw(pass, BCrypt.gensalt());
}
private boolean isValid(String clearTextPassword, String hashedPass) {
// returns true if password matches hash
return BCrypt.checkpw(clearTextPassword, hashedPass);
}

Dustin
- 693
- 8
- 20