Class Scrypt
Implements
Namespace: Libplanet.KeyStore.Kdfs
Assembly: Libplanet.dll
Syntax
public sealed class Scrypt : object, IKdf
Constructors
| Improve this Doc View SourceScrypt(Int32, in ImmutableArray<Byte>, Int32, Int32, Int32)
Configures parameters of Scrypt.
Declaration
public Scrypt(int cost, in ImmutableArray<byte> salt, int keyLength, int parallelization, int blockSize)
Parameters
Type | Name | Description |
---|---|---|
Int32 | cost | The CPU/memory cost parameter. Corresponds to |
ImmutableArray<Byte> | salt | A cryptographic salt. |
Int32 | keyLength | The desired byte-length of the derived key.
Corresponds to |
Int32 | parallelization | The parallelization parameter.
Corresponds to |
Int32 | blockSize | The blocksize parameter. Corresponds to |
Scrypt(Int32, Byte[], Int32, Int32, Int32)
Configures parameters of Scrypt.
Declaration
public Scrypt(int cost, byte[] salt, int keyLength, int parallelization, int blockSize)
Parameters
Type | Name | Description |
---|---|---|
Int32 | cost | The CPU/memory cost parameter. Corresponds to |
Byte[] | salt | A cryptographic salt. |
Int32 | keyLength | The desired byte-length of the derived key.
Corresponds to |
Int32 | parallelization | The parallelization parameter.
Corresponds to |
Int32 | blockSize | The blocksize parameter. Corresponds to |
Properties
| Improve this Doc View SourceBlockSize
The blocksize parameter. Corresponds to r
.
Declaration
public int BlockSize { get; }
Property Value
Type | Description |
---|---|
Int32 |
Cost
The CPU/memory cost parameter. Corresponds to n
.
Declaration
public int Cost { get; }
Property Value
Type | Description |
---|---|
Int32 |
KeyLength
The desired byte-length of the derived key.
Corresponds to dkLen
except that it's not bit-wise but byte-wise.
Declaration
public int KeyLength { get; }
Property Value
Type | Description |
---|---|
Int32 |
Parallelization
The parallelization parameter. Corresponds to p
.
Declaration
public int Parallelization { get; }
Property Value
Type | Description |
---|---|
Int32 |
Salt
A cryptographic salt.
Declaration
public ImmutableArray<byte> Salt { get; }
Property Value
Type | Description |
---|---|
ImmutableArray<Byte> |
Methods
| Improve this Doc View SourceDerive(String)
Derives a cryptographic key in passphrase
.
Declaration
public ImmutableArray<byte> Derive(string passphrase)
Parameters
Type | Name | Description |
---|---|---|
String | passphrase | A user input passphrase. |
Returns
Type | Description |
---|---|
ImmutableArray<Byte> | A derived cryptographic key. |
WriteJson(Utf8JsonWriter)
Dumps the KDF parameters as a JSON representation.
Declaration
public string WriteJson(Utf8JsonWriter writer)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonWriter | writer | A JSON writer which has not begun object nor array. |
Returns
Type | Description |
---|---|
String | A unique identifier of the KDF. This is going to be the
|