Crypto++  5.6.3
Free C++ class library of cryptographic schemes
Public Member Functions | List of all members
PKCS5_PBKDF2_HMAC< T > Class Template Reference

PBKDF2 from PKCS #5. More...

+ Inheritance diagram for PKCS5_PBKDF2_HMAC< T >:

Public Member Functions

size_t MaxDerivedKeyLength () const
 Provides the maximum derived key length. More...
 
bool UsesPurposeByte () const
 Determines if the derivation function uses the purpose byte. More...
 
unsigned int DeriveKey (byte *derived, size_t derivedLen, byte purpose, const byte *password, size_t passwordLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds=0) const
 Derive key from the password. More...
 

Detailed Description

template<class T>
class PKCS5_PBKDF2_HMAC< T >

PBKDF2 from PKCS #5.

Template Parameters
Ta HashTransformation class

Definition at line 64 of file pwdbased.h.

Member Function Documentation

template<class T>
size_t PKCS5_PBKDF2_HMAC< T >::MaxDerivedKeyLength ( ) const
inlinevirtual

Provides the maximum derived key length.

Returns
maximum derived key length, in bytes

Implements PasswordBasedKeyDerivationFunction.

Definition at line 67 of file pwdbased.h.

template<class T>
bool PKCS5_PBKDF2_HMAC< T >::UsesPurposeByte ( ) const
inlinevirtual

Determines if the derivation function uses the purpose byte.

Returns
true if the derivation function uses the purpose byte, false otherwise

Implements PasswordBasedKeyDerivationFunction.

Definition at line 68 of file pwdbased.h.

template<class T >
unsigned int PKCS5_PBKDF2_HMAC< T >::DeriveKey ( byte *  derived,
size_t  derivedLen,
byte  purpose,
const byte *  password,
size_t  passwordLen,
const byte *  salt,
size_t  saltLen,
unsigned int  iterations,
double  timeInSeconds = 0 
) const
virtual

Derive key from the password.

Parameters
derivedthe byte buffer to receive the derived password
derivedLenthe size of the byte buffer to receive the derived password
purposean octet indicating the purpose of the derivation
passwordthe byte buffer with the password
passwordLenthe size of the password, in bytes
saltthe byte buffer with the salt
saltLenthe size of the salt, in bytes
iterationsthe number of iterations to attempt
timeInSecondsthe length of time the derivation function should execute
Returns
iteration count achieved

DeriveKey returns the actual iteration count achieved. If timeInSeconds == 0, then the complete number of iterations will be obtained. If timeInSeconds != 0, then DeriveKey will iterate until time elapsed, as measured by ThreadUserTimer.

Implements PasswordBasedKeyDerivationFunction.

Definition at line 113 of file pwdbased.h.


The documentation for this class was generated from the following file: