Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

stKDF

Classes, interfaces and records

classeKDFError

inherits from Exception

(no public members)

interfaceiKDF

inherits from iSecretKey

function GetHashClass: tHashClass;
Getter for HashClass. Applications normally set HashClass instead of calling this directly.
procedure DeriveKey(aKeyMaterial, aParam : iSecretKey; aDKLen : Integer); overload;
Derives aDKLen bytes of output key material from aKeyMaterial (e.g. an ECDH/KEM shared secret or a pre-existing key) and aParam (algorithm-specific context/info, e.g. the HKDF salt or expand-label structure); the result is available afterwards via the inherited iSecretKey.Key/KeyLen. Full description »
procedure SetHashClass(const Value: tHashClass);
Setter for HashClass.
property HashClass: tHashClass read GetHashClass write SetHashClass;
Selects the underlying hash algorithm (e.g. SHA-256) the KDF hashes/HMACs with; must be set (or left at its class default, SHA-1 for tKDF/tPBKDF) before calling DeriveKey. Changing it mid-life on a shared KDF instance is unsafe if that instance is used concurrently -- create a fresh KDF per derivation instead.

classtKDF

inherits from tSecretKey

implements iKDF

constructor Create(aAlgorithm: ObjectIdentifier); class function CanCreate: Boolean;
Returns True if FindHashClass(haSHA1) does not equal nil; otherwise False.
procedure DeriveKey(aKeyMaterial, aParam : iSecretKey; aDKLen : Integer); overload; virtual; abstract; property HashClass: tHashClass read GetHashClass write SetHashClass;

interfaceiPBKDF

inherits from iKDF

function GetIter: Integer;
Getter for Iter.
procedure DeriveKey(aPassword, aSalt : iSecretKey; aIter, aDKLen : Integer); overload;
Password-based derivation entry point (PBKDF1/PBKDF2 style, RFC 8018): stretches aPassword with aSalt over aIter rounds to produce aDKLen bytes of key material, retrievable afterwards via the inherited iSecretKey.Key/KeyLen. Full description »
procedure SetIter(const Value: Integer);
Setter for Iter.
property Iter: Integer read GetIter write SetIter;
Iteration/round count for the password-stretching loop; higher values increase the cost of brute-forcing the password and should be set based on current guidance for the chosen hash (typical SSH password verifiers use 100000 rounds with SHA-512). Full description »

classtPBKDF

inherits from TKDF

implements iPBKDF

constructor Create(aAlgorithm: ObjectIdentifier); procedure DeriveKey(aKeyMaterial, aParam : iSecretKey; aDKLen : Integer); override; procedure DeriveKey(aPassword, aSalt : iSecretKey; aIter, aDKLen : Integer); overload; virtual; abstract; property Iter: Integer read fIter write SetIter;

classtKDF1

inherits from tKDF

implements iKDF

procedure DeriveKey(aKeyMaterial, aParam: iSecretKey; aDKLen: Integer); override;

classtKDF2

inherits from tKDF1

implements iKDF

procedure DeriveKey(aKeyMaterial, aParam: iSecretKey; aDKLen: Integer); override;

classtKDF3

inherits from tKDF1

implements iKDF

procedure DeriveKey(aKeyMaterial, aParam: iSecretKey; aDKLen: Integer); override;

classtHKDFExtract

inherits from tKDF

implements iKDF

procedure DeriveKey(aKeyMaterial, aParam: iSecretKey; aDKLen: Integer); override;

classtHKDFExpand

inherits from tKDF

implements iKDF

procedure DeriveKey(aKeyMaterial, aParam: iSecretKey; aDKLen: Integer); override;

classtWPKDF

inherits from tPBKDF

implements iPBKDF

Deprecated - use tPBKDF2_HMAC (stPkcs5) with HMAC-SHA-256, or scrypt. The StreamSec WeakPassword KDF, kept so that existing data can still be read.

procedure DeriveKey(aPassword, aSalt: iSecretKey; aIter, aDKLen: Integer); override;

classtWPKDF2

inherits from tPBKDF

implements iPBKDF

Deprecated - as tWPKDF. WeakPasswordKDFv2, the default of TstCipher's PBKDFClass in earlier releases; data keyed through it needs PBKDFClass := tWPKDF2 to be decrypted.

procedure DeriveKey(aPassword, aSalt: ISecretKey; aIter, aDKLen: Integer); override;

Types (enumerations, sets, aliases)

typetPBKDFClass

  tPBKDFClass = class of tPBKDF;

Routines