Package model
Class Locksmith
java.lang.Object
model.Locksmith
Class for hashing and checking passwords
Rainbow table attacks? I love rainbows! and tables! Don't attack them! 🌈
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckPassword(String password, String hashedPassword) Checks whether a password matches a hashed passwordstatic StringhashPassword(String password) Hashes a password using SHA-256 and Base64-encoding
-
Constructor Details
-
Locksmith
public Locksmith()
-
-
Method Details
-
hashPassword
Hashes a password using SHA-256 and Base64-encoding- Parameters:
password- The password to hash- Returns:
- The hashed password
-
checkPassword
Checks whether a password matches a hashed password- Parameters:
password- The password to checkhashedPassword- The hashed password to check against- Returns:
- true if the password matches the hashed password, false otherwise
-