Show / Hide Table of Contents

Class DecodeExtension

Extension to decode Argon2 hash strings.

Inheritance
System.Object
DecodeExtension
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 static class DecodeExtension

Methods

| Improve this Doc View Source

DecodeString(Argon2Config, String, out SecureArray<Byte>)

Decodes an Argon2 hash string into an Argon2 class instance.

Declaration
public static bool DecodeString(this Argon2Config config, string str, out SecureArray<byte> hash)
Parameters
Type Name Description
Argon2Config config

The configuration to populate with the data found in str.

System.String str

The string to decode.

SecureArray<System.Byte> hash

Loaded with the hash found in str; set to null if str does not contain a hash.

Returns
Type Description
System.Boolean

True on success; false otherwise. hash set to null on failure.

Remarks

Expected format:

$argon2<T>[$v=<num>]$m=<num>,t=<num>,p=<num>[,keyid=<bin>][,data=<bin>][$<bin>[$<bin>]].

where <T> is either 'd' or 'i', <num> is a decimal integer (positive, fits in an 'unsigned long'), and <bin> is Base64-encoded data (no '=' padding characters, no newline or whitespace). The "keyid" is a binary identifier for a key (up to 8 bytes); "data" is associated data (up to 32 bytes). When the 'keyid' (resp. the 'data') is empty, then it is omitted from the output.

The last two binary chunks (encoded in Base64) are, in that order, the salt and the output. Both are optional, but you cannot have an output without a salt. The binary salt length is between 8 and 48 bytes. The output length is always exactly 32 bytes.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX