Crypto++
5.6.4
Free C++ class library of cryptographic schemes
|
Abstract base class for password based key derivation function. More...
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... | |
Abstract base class for password based key derivation function.
Definition at line 17 of file pwdbased.h.
|
pure virtual |
Provides the maximum derived key length.
Implemented in PKCS12_PBKDF< T >, PKCS5_PBKDF2_HMAC< T >, and PKCS5_PBKDF1< T >.
|
pure virtual |
Determines if the derivation function uses the purpose byte.
Implemented in PKCS12_PBKDF< T >, PKCS5_PBKDF2_HMAC< T >, and PKCS5_PBKDF1< T >.
|
pure virtual |
Derive key from the password.
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 |
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 >.