2
$\begingroup$

Does anyone know the purpose of the "purpose" byte in the PBKDF2 implementation in Crypto++? It appears that the PBKDF2 does not use this byte, but I want to make sure I am not setting the option to some stupid default.

Here is the method signature.

If you look at line 42 of the pwdbase.h file, it seems to indicate that this parameter is ignored by PBKDF2 implementation.

$\endgroup$

1 Answer 1

4
$\begingroup$

This seems to only be used in the PKCS12_PBKDF<T>::DeriveKey implementation. According to the PKCS12 specification,

The following procedure can be used to produce pseudo-random bits for a particular “purpose” which is identified by a byte, ID. The meaning of this ID byte will be discussed later.

The spec actually declares three values this ID byte can take, depending on the actual purpose of the key derivation.

It's not used for PBKDF2, and seems to only be present in its signature to have the DeriveKey method of PasswordBasedKeyDerivationFunction be usable for all subclasses here.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.