ScryptParameters Class
Definition
- Namespace
- Bodu.Security.Cryptography
- Assembly
- Bodu.Security.Cryptography.dll
- Package
- Bodu.Security.Cryptography 1.2.0
- Source
- ScryptParameters.cs
Specifies the cost parameters for a scrypt key-derivation or password-hashing operation, as defined by RFC 7914.
public sealed record ScryptParameters : IEquatable<ScryptParameters>
- Inheritance
-
ScryptParameters
- Implements
- Inherited Members
- Extension Methods
Remarks
The peak memory cost of scrypt is approximately 128 * N * r bytes. RFC 7914, Section 2 suggests
N = 16384, r = 8, p = 1 for interactive logins (about 16 MiB), scaling N up for more
sensitive applications.
Constructors
ScryptParameters()
public ScryptParameters()
Properties
BlockSizeR
Gets the block-size parameter r, which tunes memory usage relative to CostN.
public required int BlockSizeR { get; init; }
Property Value
- int
The block-size parameter
r.
CostN
Gets the CPU/memory cost parameter N - a power of two greater than one.
public required int CostN { get; init; }
Property Value
- int
The cost parameter
N.
Parallelization
Gets the parallelization parameter p.
public required int Parallelization { get; init; }
Property Value
- int
The parallelization parameter
p.
Methods
Equals(ScryptParameters?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ScryptParameters? other)
Parameters
otherScryptParametersAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
operator ==(ScryptParameters?, ScryptParameters?)
public static bool operator ==(ScryptParameters? left, ScryptParameters? right)
Parameters
leftScryptParametersrightScryptParameters
Returns
operator !=(ScryptParameters?, ScryptParameters?)
public static bool operator !=(ScryptParameters? left, ScryptParameters? right)
Parameters
leftScryptParametersrightScryptParameters
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |