Test for correct hashing of non-US-ASCII passwords
()
| 177 | * Test for correct hashing of non-US-ASCII passwords |
| 178 | */ |
| 179 | public void testInternationalChars() { |
| 180 | System.out.print("BCrypt.hashpw w/ international chars: "); |
| 181 | String pw1 = "ππππππππ"; |
| 182 | String pw2 = "????????"; |
| 183 | |
| 184 | String h1 = BCrypt.hashpw(pw1, BCrypt.gensalt()); |
| 185 | assertFalse(BCrypt.checkpw(pw2, h1)); |
| 186 | System.out.print("."); |
| 187 | |
| 188 | String h2 = BCrypt.hashpw(pw2, BCrypt.gensalt()); |
| 189 | assertFalse(BCrypt.checkpw(pw1, h2)); |
| 190 | System.out.print("."); |
| 191 | System.out.println(""); |
| 192 | } |
| 193 | |
| 194 | } |