Package model

Class Locksmith

java.lang.Object
model.Locksmith

public class Locksmith extends Object
Class for hashing and checking passwords Rainbow table attacks? I love rainbows! and tables! Don't attack them! 🌈
  • Constructor Details

    • Locksmith

      public Locksmith()
  • Method Details

    • hashPassword

      public static String hashPassword(String password)
      Hashes a password using SHA-256 and Base64-encoding
      Parameters:
      password - The password to hash
      Returns:
      The hashed password
    • checkPassword

      public static boolean checkPassword(String password, String hashedPassword)
      Checks whether a password matches a hashed password
      Parameters:
      password - The password to check
      hashedPassword - The hashed password to check against
      Returns:
      true if the password matches the hashed password, false otherwise