Show / Hide Table of Contents

Class Pbkdf2<T>

PBKDF2.

Inheritance
Object
Pbkdf2<T>
Implements
IKdf
Namespace: Libplanet.KeyStore.Kdfs
Assembly: Libplanet.dll
Syntax
public sealed class Pbkdf2<T> : object, IKdf where T : GeneralDigest, new()
Type Parameters
Name Description
T

PRF (pseudorandom function) to use, e.g., .

Constructors

| Improve this Doc View Source

Pbkdf2(Int32, ImmutableArray<Byte>, Int32)

Configures parameters of PBKDF2.

Declaration
public Pbkdf2(int iterations, in ImmutableArray<byte> salt, int keyLength)
Parameters
Type Name Description
Int32 iterations

The number of iterations desired. Corresponds to c.

ImmutableArray<Byte> salt

A cryptographic salt.

Int32 keyLength

The desired byte-length of the derived key. Corresponds to dkLen except that it's not bit-wise but byte-wise.

| Improve this Doc View Source

Pbkdf2(Int32, Byte[], Int32)

Configures parameters of PBKDF2.

Declaration
public Pbkdf2(int iterations, byte[] salt, int keyLength)
Parameters
Type Name Description
Int32 iterations

The number of iterations desired. Corresponds to c.

Byte[] salt

A cryptographic salt.

Int32 keyLength

The desired byte-length of the derived key. Corresponds to dkLen except that it's not bit-wise but byte-wise.

Properties

| Improve this Doc View Source

Iterations

The number of iterations desired. Corresponds to c.

Declaration
public int Iterations { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

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
| Improve this Doc View Source

Salt

A cryptographic salt.

Declaration
public ImmutableArray<byte> Salt { get; }
Property Value
Type Description
ImmutableArray<Byte>

Methods

| Improve this Doc View Source

Derive(String)

Derives a cryptographic key in s from a user input 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.

| Improve this Doc View Source

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 crypto.kdf field in the key JSON file.

Implements

IKdf
  • Improve this Doc
  • View Source
Back to top Copyright © 2019–2020 Planetarium