Crypto++
8.0
Free C++ class library of cryptographic schemes
|
PBKDF from PKCS #12, appendix B. More...
Public Member Functions | |
std::string | AlgorithmName () const |
Provides the name of this algorithm. More... | |
size_t | MaxDerivedKeyLength () const |
size_t | GetValidDerivedLength (size_t keylength) const |
Returns a valid key length for the derivation function. More... | |
size_t | DeriveKey (byte *derived, size_t derivedLen, const byte *secret, size_t secretLen, const NameValuePairs ¶ms=g_nullNameValuePairs) const |
Derive a key from a seed. More... | |
size_t | DeriveKey (byte *derived, size_t derivedLen, byte purpose, const byte *secret, size_t secretLen, const byte *salt, size_t saltLen, unsigned int iterations, double timeInSeconds) const |
Derive a key from a secret seed. More... | |
![]() | |
virtual size_t | MinDerivedLength () const |
Determine minimum number of bytes. More... | |
virtual size_t | MaxDerivedLength () const |
Determine maximum number of bytes. More... | |
virtual bool | IsValidDerivedLength (size_t keylength) const |
Returns whether keylength is a valid key length. More... | |
virtual void | SetParameters (const NameValuePairs ¶ms) |
Set or change parameters. More... | |
![]() | |
Algorithm (bool checkSelfTestStatus=true) | |
Interface for all crypto algorithms. More... | |
virtual std::string | AlgorithmProvider () const |
Retrieve the provider of this algorithm. More... | |
![]() | |
virtual Clonable * | Clone () const |
Copies this object. More... | |
Static Public Member Functions | |
static std::string | StaticAlgorithmName () |
PBKDF from PKCS #12, appendix B.
T | a HashTransformation class |
Definition at line 303 of file pwdbased.h.
|
inlinevirtual |
Provides the name of this algorithm.
Implements KeyDerivationFunction.
Definition at line 315 of file pwdbased.h.
|
virtual |
Returns a valid key length for the derivation function.
keylength | the size of the derived key, in bytes |
Implements KeyDerivationFunction.
Definition at line 360 of file pwdbased.h.
|
virtual |
Derive a key from a seed.
derived | the derived output buffer |
derivedLen | the size of the derived buffer, in bytes |
secret | the seed input buffer |
secretLen | the size of the secret buffer, in bytes |
params | additional initialization parameters to configure this object |
InvalidDerivedLength | if derivedLen is invalid for the scheme |
DeriveKey() provides a standard interface to derive a key from a secret seed and other parameters. Each class that derives from KeyDerivationFunction provides an overload that accepts most parameters used by the derivation function.
the number of iterations performed by DeriveKey() may be 1. For example, a scheme like HKDF does not use the iteration count so it returns 1.
Implements KeyDerivationFunction.
Definition at line 368 of file pwdbased.h.
size_t PKCS12_PBKDF< T >::DeriveKey | ( | byte * | derived, |
size_t | derivedLen, | ||
byte | purpose, | ||
const byte * | secret, | ||
size_t | secretLen, | ||
const byte * | salt, | ||
size_t | saltLen, | ||
unsigned int | iterations, | ||
double | timeInSeconds | ||
) | const |
Derive a key from a secret seed.
derived | the derived output buffer |
derivedLen | the size of the derived buffer, in bytes |
purpose | a purpose byte |
secret | the seed input buffer |
secretLen | the size of the secret buffer, in bytes |
salt | the salt input buffer |
saltLen | the size of the salt buffer, in bytes |
iterations | the number of iterations |
timeInSeconds | the in seconds |
InvalidDerivedLength | if derivedLen is invalid for the scheme |
DeriveKey() provides a standard interface to derive a key from a seed and other parameters. Each class that derives from KeyDerivationFunction provides an overload that accepts most parameters used by the derivation function.
If timeInSeconds
is > 0.0
then DeriveKey will run for the specified amount of time. If timeInSeconds
is 0.0
then DeriveKey will run for the specified number of iterations.
Definition at line 389 of file pwdbased.h.