Package page.codeberg.friedolyn.crypto
Enum Class Argon2Variant
- All Implemented Interfaces:
Serializable
,Comparable<Argon2Variant>
,Constable
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 ConstantsEnum ConstantDescriptionArgon2d 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.Argon2i is optimized to resist side-channel attacks.Argon2id is a hybrid version. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Argon2Variant
Returns the enum constant of this class with the specified name.static Argon2Variant[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
Argon2i is optimized to resist side-channel attacks. It accesses the memory array in a password independent order.
– Wikipedia -
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.
– WikipediaArgon2id 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
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
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 nameNullPointerException
- if the argument is null
-