diff --git a/services/users/pom.xml b/services/users/pom.xml
index ccba08e2..bb2b9ccf 100644
--- a/services/users/pom.xml
+++ b/services/users/pom.xml
@@ -123,9 +123,9 @@
- org.mindrot
- jbcrypt
- 0.4
+ com.google.guava
+ guava
+ 32.1.3-jre
diff --git a/services/users/src/main/java/com/workup/users/commands/utils/PasswordHasher.java b/services/users/src/main/java/com/workup/users/commands/utils/PasswordHasher.java
index 87bebe26..53fc28d3 100644
--- a/services/users/src/main/java/com/workup/users/commands/utils/PasswordHasher.java
+++ b/services/users/src/main/java/com/workup/users/commands/utils/PasswordHasher.java
@@ -1,13 +1,14 @@
package com.workup.users.commands.utils;
-import org.mindrot.jbcrypt.BCrypt;
+import com.google.common.hash.Hashing;
+import java.nio.charset.StandardCharsets;
public class PasswordHasher {
public static String hashPassword(String password) {
- return BCrypt.hashpw(password, BCrypt.gensalt());
+ return Hashing.sha256().hashString(password, StandardCharsets.UTF_8).toString();
}
public static boolean checkPassword(String inputPassword, String hashedPassword) {
- return BCrypt.checkpw(inputPassword, hashedPassword);
+ return hashPassword(inputPassword).equals(hashedPassword);
}
}