PbeKdf2(Int32, String, String, Int32, HashAlgorithm) Method |
Derives a key in hex format of any length from a password with the salt in hex format using specified HMAC algorithm
Namespace: CryptoSysAPIAssembly: diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.24248 (6.22.2.0)
Syntaxpublic static string Kdf2(
int dkLen,
string pwdStr,
string saltHex,
int count,
HashAlgorithm hashAlg = HashAlgorithm.Sha1
)
Public Shared Function Kdf2 (
dkLen As Integer,
pwdStr As String,
saltHex As String,
count As Integer,
Optional hashAlg As HashAlgorithm = HashAlgorithm.Sha1
) As String
Parameters
- dkLen Int32
- Required length of key in bytes
- pwdStr String
- Password
- saltHex String
- Salt in hex format
- count Int32
- Iteration count
- hashAlg HashAlgorithm (Optional)
- Hash algorithm to use in HMAC PRF (optional, default=SHA-1)
Return Value
StringKey in hex format
RemarksPassword pwdStr is normal text, not hexadecimal
Examplestring keyHex = Pbe.Kdf2(24, "password", "78578e5a5d63cb06", 2048);
See Also