Show / Hide Table of Contents

Class Argon2Config

Holds configuration needed to perform an Argon2 hash.

Inheritance
System.Object
Argon2Config
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Isopoh.Cryptography.Argon2
Assembly: Isopoh.Cryptography.Argon2.dll
Syntax
public sealed class Argon2Config

Properties

| Improve this Doc View Source

AssociatedData

Gets or sets the associated data used in the password hash.

Declaration
public byte[] AssociatedData { get; set; }
Property Value
Type Description
System.Byte[]
| Improve this Doc View Source

ClearPassword

Gets or sets a value indicating whether to clear the password as soon as it is no longer needed.

Declaration
public bool ClearPassword { get; set; }
Property Value
Type Description
System.Boolean
Remarks

If true and the configuration has a password, the configuration cannot be used more than once without resetting the password (unless you want an all zero password).

| Improve this Doc View Source

ClearSecret

Gets or sets a value indicating whether to clear the secret as soon as it is no longer needed.

Declaration
public bool ClearSecret { get; set; }
Property Value
Type Description
System.Boolean
Remarks

If true and the configuration has a secret, the configuration cannot be used more than once without resetting the secret (unless you want an all zero secret).

| Improve this Doc View Source

HashLength

Gets or sets the hash length to output. Minimum of 4. Default 32.

Declaration
public int HashLength { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Lanes

Gets or sets the lanes used in the password hash. Minimum of 1. Defaults to 4.

Declaration
public int Lanes { get; set; }
Property Value
Type Description
System.Int32
Remarks

This describes the maximum parallelism that can be achieved. Each "lane" can be processed individually in its own thread. Setting Threads to a value greater than one when there is more than one lane will allow the use of multiple cores to speed up hashing.

| Improve this Doc View Source

MemoryCost

Gets or sets the memory cost used in the password hash. Minimum of 1. Defaults to 65536.

Declaration
public int MemoryCost { get; set; }
Property Value
Type Description
System.Int32
Remarks

This translates into a target count of memory blocks to use for hashing. A memory block is 1024 bytes so the default 65536 is for a 64MB hash.

If this value is less than 2*SyncPointCount*Lanes, than 2*SyncPointCount*Lanes will be used.

If this value is not a multiple of SyncPointCount*Lanes, than it is rounded down to a multiple of SyncPointCount*Lanes.

| Improve this Doc View Source

Password

Gets or sets the password to hash.

Declaration
public byte[] Password { get; set; }
Property Value
Type Description
System.Byte[]
| Improve this Doc View Source

Salt

Gets or sets the salt used in the password hash. If non-null, must be at least 8 bytes.

Declaration
public byte[] Salt { get; set; }
Property Value
Type Description
System.Byte[]
| Improve this Doc View Source

Secret

Gets or sets the secret used in the password hash.

Declaration
public byte[] Secret { get; set; }
Property Value
Type Description
System.Byte[]
| Improve this Doc View Source

SecureArrayCall

Gets or sets the methods that get called to secure arrays. Defaults to SecureArray.DefaultCall.

Declaration
public SecureArrayCall SecureArrayCall { get; set; }
Property Value
Type Description
SecureArrayCall
| Improve this Doc View Source

Threads

Gets or sets the threads used in the password hash. Minimum of 1. Defaults to 1.

Declaration
public int Threads { get; set; }
Property Value
Type Description
System.Int32
Remarks

This value makes no difference in the result. A value greater than one causes that many threads to get spawned to do the work on top of the main thread that orchestrates which thread does what work.

Lanes defines the maximum parallelism that can be achieved. Setting Threads to a value greater than Lanes will not result in more than Lanes threads running.

| Improve this Doc View Source

TimeCost

Gets or sets the time cost used in the password hash. Minimum of 1. Defaults to 3.

Declaration
public int TimeCost { get; set; }
Property Value
Type Description
System.Int32
Remarks

This is the number of iterations to perform. There are attacks on the Argon2Version.Sixteen with less than three iterations (if I'm reading the paper correctly). So, use a value greater then 3 here if you are not using Argon2Version.Nineteen.

| Improve this Doc View Source

Type

Gets or sets the Argon2 type. Default to hybrid.

Declaration
public Argon2Type Type { get; set; }
Property Value
Type Description
Argon2Type
| Improve this Doc View Source

Version

Gets or sets the Argon2 version used in the password hash. Defaults to Argon2Version.Nineteen (0x13).

Declaration
public Argon2Version Version { get; set; }
Property Value
Type Description
Argon2Version

Extension Methods

DecodeExtension.DecodeString(Argon2Config, String, out SecureArray<Byte>)
EncodeExtension.EncodeString(Argon2Config, Byte[])
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX