Hash a password using the OpenBSD bcrypt scheme @param password the password to hash @param salt the salt to hash with (perhaps generated using BCrypt.gensalt) @return the hashed password
(String password, String salt)
| 730 | * @return the hashed password |
| 731 | */ |
| 732 | public static String hashpw(String password, String salt) { |
| 733 | byte passwordb[]; |
| 734 | |
| 735 | try { |
| 736 | passwordb = password.getBytes("UTF-8"); |
| 737 | } catch (UnsupportedEncodingException uee) { |
| 738 | throw new AssertionError("UTF-8 is not supported"); |
| 739 | } |
| 740 | |
| 741 | return hashpw(passwordb, salt); |
| 742 | } |
| 743 | |
| 744 | /** |
| 745 | * Hash a password using the OpenBSD bcrypt scheme |