# Class Pbkdf2Algorithm
Namespace: [CapyKit](CapyKit.md)
Assembly: CapyKit.dll
Implements the PBKDF2 algorithm for password encryption.
```csharp
public class Pbkdf2Algorithm : IPasswordAlgorithm
```
#### Inheritance
[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[Pbkdf2Algorithm](CapyKit.Pbkdf2Algorithm.md)
#### Implements
[IPasswordAlgorithm](CapyKit.IPasswordAlgorithm.md)
#### Inherited Members
[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)),
[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)),
[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode),
[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype),
[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone),
[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals),
[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring)
#### Extension Methods
[ObjectExtensions.UpdateProperties\(Pbkdf2Algorithm, Pbkdf2Algorithm\)](CapyKit.Extensions.ObjectExtensions.md\#CapyKit\_Extensions\_ObjectExtensions\_UpdateProperties\_\_1\_\_\_0\_\_\_0\_),
[ObjectExtensions.UpdateProperties\(object, object\)](CapyKit.Extensions.ObjectExtensions.md\#CapyKit\_Extensions\_ObjectExtensions\_UpdateProperties\_System\_Object\_System\_Object\_)
## Constructors
### Pbkdf2Algorithm\(\)
Default constructor.
```csharp
public Pbkdf2Algorithm()
```
## Fields
### ITERATIONS
The default number of iterations.
```csharp
public const int ITERATIONS = 100000
```
#### Field Value
[int](https://learn.microsoft.com/dotnet/api/system.int32)
#### Remarks
This member is immutable.
### LENGTH
(Immutable) The default length.
```csharp
public const int LENGTH = 32
```
#### Field Value
[int](https://learn.microsoft.com/dotnet/api/system.int32)
#### Remarks
This member is immutable.
## Properties
### AlgorithmName
Gets the name of the algorithm.
```csharp
public string AlgorithmName { get; }
```
#### Property Value
[string](https://learn.microsoft.com/dotnet/api/system.string)
## Methods
### Encrypt\(string, params object\[\]\)
Encrypts the given password using a PBKDF2 algorithm.
```csharp
public byte[] Encrypt(string password, params object[] args)
```
#### Parameters
`password` [string](https://learn.microsoft.com/dotnet/api/system.string)
The plaintext password.
`args` [object](https://learn.microsoft.com/dotnet/api/system.object)\[\]
Additional arguments for the encryption process, specifically
saltlengthiterations
#### Returns
[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[\]
A byte array with the hashed password.