CryptoSys API Library Manual

Pbe.Kdf2 Method (Int32, String, String, Int32, HashAlgorithm)

Derives a key in hex format of any length from a password with the salt in hex format using specified HMAC algorithm

Syntax

[C#]
public static string Kdf2(
	int dkLen,
	string pwdStr,
	string saltHex,
	int count,
	HashAlgorithm hashAlg
)
[VB.NET]
Public Shared Function Kdf2 ( _
	dkLen As Integer, _
	pwdStr As String, _
	saltHex As String, _
	count As Integer, _
	hashAlg As HashAlgorithm _
) As String

Parameters

dkLen
Required length of key in bytes
pwdStr
Password
saltHex
Salt in hex format
count
Iteration count
hashAlg
Type: HashAlgorithm
Hash algorithm to use in HMAC PRF (optional, default=SHA-1)

Return Value

Key in hex format

Remarks

Password pwdStr is normal text, not hexadecimal

Example

[C#]
string keyHex = Pbe.Kdf2(24, "password", "78578e5a5d63cb06", 2048);
// BFDE6BE94DF7E11DD409BCE20A0255EC327CB936FFE93643

See Also

VB6/C equivalent: PBE_Kdf2Hex

[Contents] [Index]

[PREV: Pbe.Kdf2 Method (Int32, Byte, Byte, Int32, HashAlgorithm)...]   [Contents]   [Index]   
   [NEXT: Pbe.Scrypt Method (Int32, Byte, Byte, Int32, Int32, Int32)...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.