Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

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

1 Answer 1

up vote 2 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

 
discard

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.