Table of Contents

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

other ScryptParameters

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

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

left ScryptParameters
right ScryptParameters

Returns

bool

operator !=(ScryptParameters?, ScryptParameters?)

public static bool operator !=(ScryptParameters? left, ScryptParameters? right)

Parameters

left ScryptParameters
right ScryptParameters

Returns

bool

Applies to

ProductVersions
.NET8, 10