Class SCryptV2

java.lang.Object
overit.geocall.util.password.PasswordAlgo
overit.geocall.util.password.SCryptV2

public class SCryptV2 extends PasswordAlgo
Class that manages the SCrypt algorithm used to store the password. This implementation follow the guidelines of ACN (Agenzia per la Cybersicurezza Nazionale) that states to use SCrypt as algorithm with 8MiB of memory, 8 of block size and 10 as parallelism.
  • Constructor Details

    • SCryptV2

      public SCryptV2()
  • Method Details

    • generate

      public String generate(String password)
      Description copied from class: PasswordAlgo
      Generates the hashed password
      Specified by:
      generate in class PasswordAlgo
      Parameters:
      password - To hash
      Returns:
      The hashed password
    • check

      public boolean check(String password, String stored)
      Description copied from class: PasswordAlgo
      Checks if the stored hashed password corresponds
      Specified by:
      check in class PasswordAlgo
      Parameters:
      password - The password to check
      stored - The stored password to check
      Returns:
      true if the password corresponds to the stored one, false otherwise
    • getType

      public PasswordAlgo.Type getType()
      Description copied from class: PasswordAlgo
      Returns the type of algorithm used
      Specified by:
      getType in class PasswordAlgo
      Returns:
      The type of algorithm used