Enum Class Argon2Variant

java.lang.Object
java.lang.Enum<Argon2Variant>
de.gustavblass.commons.crypto.Argon2Variant
All Implemented Interfaces:
Serializable, Comparable<Argon2Variant>, Constable

public enum Argon2Variant extends Enum<Argon2Variant>
The variant of the Argon2 key derivation function that shall be used. Strongly recommended: ARGON2_ID.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description

    Argon2i is optimized to resist side-channel attacks. It accesses the memory array in a password independent order.

    Wikipedia

    Argon2id is a hybrid version. It follows the Argon2i approach for the first half pass over memory and the Argon2d approach for subsequent passes. RFC 9106 recommends using Argon2id if you do not know the difference between the types or you consider side-channel attacks to be a viable threat.

    Wikipedia

    Argon2id is optimized for more realistic settings, where the adversary can possibly access the same machine, use its CPU, or mount cold-boot attacks.

    RFC 9106, Section 4

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Argon2Variant(int variant)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static Argon2Variant[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • ARGON2_D

      public static final Argon2Variant ARGON2_D

      Argon2d is optimized for settings where the adversary does not get regular access to system memory or CPU, i.e., they cannot run side-channel attacks based on the timing information, nor can they recover the password much faster using garbage collection. These settings are more typical for backend servers and cryptocurrency minings.

      RFC 9106, Section 4

    • ARGON2_I

      public static final Argon2Variant ARGON2_I

      Argon2i is optimized to resist side-channel attacks. It accesses the memory array in a password independent order.

      Wikipedia

    • ARGON2_ID

      public static final Argon2Variant ARGON2_ID

      Argon2id is a hybrid version. It follows the Argon2i approach for the first half pass over memory and the Argon2d approach for subsequent passes. RFC 9106 recommends using Argon2id if you do not know the difference between the types or you consider side-channel attacks to be a viable threat.

      Wikipedia

      Argon2id is optimized for more realistic settings, where the adversary can possibly access the same machine, use its CPU, or mount cold-boot attacks.

      RFC 9106, Section 4

  • Field Details

    • variant

      public final int variant
  • Constructor Details

    • Argon2Variant

      private Argon2Variant(int variant)
  • Method Details

    • values

      public static Argon2Variant[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Argon2Variant valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null