Enum Class NistSecurityLevel
- All Implemented Interfaces:
Serializable,Comparable<NistSecurityLevel>,Constable
Security levels categorize cryptographic algorithms based on their computational resistance to attacks, measured in equivalent symmetric key strength (AES). NIST uses these levels to classify post-quantum algorithms standardized in FIPS 203, 204, and 205.
Security Level Guidelines:
| Level | Equivalent Security | Use Cases | Data Lifetime |
|---|---|---|---|
| 1 | AES-128 (128-bit) | Legacy compatibility, short-lived data | < 1 year |
| 3 | AES-192 (192-bit) | Standard production (RECOMMENDED) | 1-10 years |
| 5 | AES-256 (256-bit) | High-security, classified data, long-term archives | 10+ years |
Regulatory Requirements:
- BSI (Germany): Minimum Level 3 required (BSI TR-02102-1)
- ANSSI (France): Minimum Level 3 required (ANSSI RGS v2.0)
- ETSI (EU Telecom): Minimum Level 3 required (ETSI TS 103 744)
- NIST (USA): Level 1+ allowed, Level 3+ recommended (NIST CSWP 39)
Example Usage:
// Recommended for most production scenarios
NistSecurityLevel level = NistSecurityLevel.LEVEL_3;
System.out.println(level.getBitSecurity()); // 192
// Filter algorithms by security level
AlgorithmFilter filter = AlgorithmFilter.builder()
.withMinSecurityLevel(3)
.withStatus(AlgorithmInfo.Status.RECOMMENDED)
.build();
List<AlgorithmInfo> algorithms = sdk.getSupportedAlgorithms(filter);
- Since:
- 3.0.0
- 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic NistSecurityLevelfromLevel(int level) Parses a security level from its numeric value.intReturns the equivalent symmetric key strength in bits.Returns a human-readable description of this security level.intgetLevel()Returns the numeric security level.booleanmeetsMinimum(NistSecurityLevel minimumLevel) Checks if this security level meets or exceeds a minimum required level.toString()static NistSecurityLevelReturns the enum constant of this class with the specified name.static NistSecurityLevel[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Enum Constant Details
-
LEVEL_1
NIST Security Level 1 - Equivalent to AES-128 (128-bit security).Security: 128-bit symmetric key strength
Quantum resistance: Adequate for short-term protection
Use cases: Legacy compatibility, non-sensitive data, session tokens
Recommendation: ⚠️ NOT recommended for production - use Level 3+
Data lifetime: < 1 yearExample Algorithms:
Classical: RSA-2048, ECDSA-P256
PQC: ML-KEM-512, ML-DSA-44 -
LEVEL_3
NIST Security Level 3 - Equivalent to AES-192 (192-bit security).Security: 192-bit symmetric key strength
Quantum resistance: Strong protection for medium to long-term
Use cases: ✅ RECOMMENDED for 95% of production scenarios
Compliance: Minimum level required by BSI, ANSSI, ETSI
Data lifetime: 1-10 yearsExample Algorithms:
Classical: X25519, Ed25519, RSA-3072, ECDSA-P384
PQC: ML-KEM-768, ML-DSA-65Regulatory Compliance:
✅ BSI TR-02102-1 (Germany)
✅ ANSSI RGS v2.0 (France)
✅ ETSI TS 103 744 (EU Telecom)
✅ NIST SP 800-227 (USA) -
LEVEL_5
NIST Security Level 5 - Equivalent to AES-256 (256-bit security).Security: 256-bit symmetric key strength
Quantum resistance: Maximum protection for highly sensitive data
Use cases: Government/defense, classified data, long-term archives (10+ years)
Performance: ⚠️ Slower than Level 3 (larger keys/signatures)
Data lifetime: 10+ yearsExample Algorithms:
Classical: RSA-4096, ECDSA-P521
PQC: ML-KEM-1024, ML-DSA-87Trade-offs:
✅ Maximum security
⚠️ Larger key sizes (increased bandwidth/storage)
⚠️ Slower operations (encryption/signing/verification)
-
-
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
-
getLevel
public int getLevel()Returns the numeric security level.- Returns:
- the level value (1, 3, or 5)
-
getBitSecurity
public int getBitSecurity()Returns the equivalent symmetric key strength in bits.This value represents the computational effort required to break the cryptographic algorithm, measured in terms of AES key size.
- Returns:
- the bit security (128, 192, or 256)
-
getDescription
Returns a human-readable description of this security level.- Returns:
- the description (e.g., "AES-192 equivalent (RECOMMENDED for production)")
-
fromLevel
Parses a security level from its numeric value.Example:
NistSecurityLevel level = NistSecurityLevel.fromLevel(3); // Returns LEVEL_3- Parameters:
level- the numeric level (1, 3, or 5)- Returns:
- the matching NistSecurityLevel enum value
- Throws:
IllegalArgumentException- if the level is not 1, 3, or 5
-
meetsMinimum
Checks if this security level meets or exceeds a minimum required level.Example:
NistSecurityLevel.LEVEL_5.meetsMinimum(NistSecurityLevel.LEVEL_3); // true NistSecurityLevel.LEVEL_1.meetsMinimum(NistSecurityLevel.LEVEL_3); // false- Parameters:
minimumLevel- the minimum required security level- Returns:
trueif this level is greater than or equal to the minimum- Throws:
IllegalArgumentException- if minimumLevel is null
-
toString
- Overrides:
toStringin classEnum<NistSecurityLevel>
-