CryptoSys API  6.22.1
Public Types | Static Public Member Functions | List of all members
crsysapi::Pbe Class Reference

Password-based encryption. More...

Public Types

enum class  PrfAlg
 PRF algorithm. More...
 

Static Public Member Functions

static bvec_t Kdf2 (int dklen, const std::string &password, const bvec_t &salt, int count, PrfAlg prfalg=PrfAlg::Hmac_Sha1)
 Derives a key of any length from a password using the PBKDF2 algorithm from PKCS#5 v2.1. More...
 

Detailed Description

Password-based encryption.

Member Enumeration Documentation

◆ PrfAlg

enum crsysapi::Pbe::PrfAlg
strong

PRF algorithm.

Enumerator
Hmac_Sha1 

HMAC-SHA-1

Hmac_Sha224 

HMAC-SHA-224.

Hmac_Sha256 

HMAC-SHA-256.

Hmac_Sha384 

HMAC-SHA-384.

Hmac_Sha512 

HMAC-SHA-512.

Member Function Documentation

◆ Kdf2()

static bvec_t crsysapi::Pbe::Kdf2 ( int  dklen,
const std::string &  password,
const bvec_t salt,
int  count,
PrfAlg  prfalg = PrfAlg::Hmac_Sha1 
)
static

Derives a key of any length from a password using the PBKDF2 algorithm from PKCS#5 v2.1.

Parameters
dklenRequired length of key in bytes
passwordPassword
saltSalt in byte format
countIteration count
prfalgAlgorithm to use in PRF (default=HMAC-SHA-1)
Returns
Derived key.
Copyright © 2001-24 D.I. Management Services Pty Limited ABN 78 083 210 584 Australia. All rights reserved. <www.di-mgt.com.au> <www.cryptosys.net>. Generated on Sat Jan 6 2024 18:00:07 by Doxygen 1.9.1.