Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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