PasswordBasedKeyDerivationFunction Class Referenceabstract

Abstract base class for password based key derivation function. More...

Inheritance diagram for PasswordBasedKeyDerivationFunction:

## Public Member Functions

virtual size_t | MaxDerivedKeyLength () const =0
| Provides the maximum derived key length. More...
virtual bool | UsesPurposeByte () const =0
| Determines if the derivation function uses the purpose byte. More...
virtual 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 =0
| Derive key from the password. More...

## Detailed Description

Abstract base class for password based key derivation function.

Definition at line 17 of file pwdbased.h.

## Member Function Documentation

## MaxDerivedKeyLength()

virtual size_t PasswordBasedKeyDerivationFunction::MaxDerivedKeyLength | ( |  | ) | const

pure virtual

Provides the maximum derived key length.

Returns
  maximum derived key length, in bytes

Implemented in PKCS12_PBKDF< T >, PKCS5_PBKDF2_HMAC< T >, and PKCS5_PBKDF1< T >.

## UsesPurposeByte()

virtual bool PasswordBasedKeyDerivationFunction::UsesPurposeByte | ( |  | ) | const

pure virtual

Determines if the derivation function uses the purpose byte.

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

Implemented in PKCS12_PBKDF< T >, PKCS5_PBKDF2_HMAC< T >, and PKCS5_PBKDF1< T >.

## DeriveKey()

virtual unsigned int PasswordBasedKeyDerivationFunction::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

pure virtual

Derive key from the password.

Parameters

  derived | the byte buffer to receive the derived password
  derivedLen | the size of the byte buffer to receive the derived password
  purpose | an octet indicating the purpose of the derivation
  password | the byte buffer with the password
  passwordLen | the size of the password, in bytes
  salt | the byte buffer with the salt
  saltLen | the size of the salt, in bytes
  iterations | the number of iterations to attempt
  timeInSeconds | the 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.

Implemented in PKCS5_PBKDF2_HMAC< T >, PKCS5_PBKDF1< T >, and PKCS12_PBKDF< T >.

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

- pwdbased.h