Class SRP6.Salt
java.lang.Object
br.net.dd.netherwingcore.common.cryptography.authentication.SRP6.Salt
- Enclosing class:
SRP6
Represents a fixed-length salt used in SRP computations.
The salt is critical for protecting against brute-force attacks by being incorporated into hash calculations.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
SALT_LENGTH
public static final int SALT_LENGTH- See Also:
-
-
Constructor Details
-
Salt
public Salt(byte[] value) Constructs a Salt instance using a provided fixed-length byte array.- Parameters:
value- A byte array of exactly 32 bytes.- Throws:
IllegalArgumentException- if the provided byte array is not of the required length.
-
Salt
public Salt()Constructs a Salt instance by generating random bytes of a fixed length. Uses a secure random number generator.
-
-
Method Details
-
getValue
public byte[] getValue()Returns the value of the salt as a byte array.- Returns:
- A copy of the internal salt byte array.
-
toString
-