Class Argon2V2

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

public class Argon2V2 extends PasswordAlgo
Class that manages the Argon2 algorithm used to store the password. This implementation follow the guidelines of ACN (Agenzia per la Cybersicurezza Nazionale) that states to use Argon2id as algorithm with 7MiB of memory, 5 iterations and 1 as parallelism.
  • Constructor Details

    • Argon2V2

      public Argon2V2()
  • 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