CapyKit/Docs/api/CapyKit.Pbkdf2Algorithm.md

3.3 KiB

Class Pbkdf2Algorithm

Namespace: CapyKit
Assembly: CapyKit.dll

Implements the PBKDF2 algorithm for password encryption.

public class Pbkdf2Algorithm : IPasswordAlgorithm

Inheritance

objectPbkdf2Algorithm

Implements

IPasswordAlgorithm

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Extension Methods

ObjectExtensions.UpdateProperties<Pbkdf2Algorithm>(Pbkdf2Algorithm, Pbkdf2Algorithm), ObjectExtensions.UpdateProperties(object, object)

Constructors

Pbkdf2Algorithm()

Default constructor.

public Pbkdf2Algorithm()

Fields

ITERATIONS

The default number of iterations.

public const int ITERATIONS = 100000

Field Value

int

Remarks

This member is immutable.

LENGTH

(Immutable) The default length.

public const int LENGTH = 32

Field Value

int

Remarks

This member is immutable.

Properties

AlgorithmName

Gets the name of the algorithm.

public string AlgorithmName { get; }

Property Value

string

Methods

Encrypt(string, params object[])

Encrypts the given password using a PBKDF2 algorithm.

public byte[] Encrypt(string password, params object[] args)

Parameters

password string

The plaintext password.

args object[]

Additional arguments for the encryption process, specifically

  1. salt
  2. length
  3. iterations

Returns

byte[]

A byte array with the hashed password.