The PBKDF2 class The security.PBKDF2 class generates passwords using the Password-Based Key Derivation Function 2 (PBKDF2). security.PBKDF2 methods Methods of the security.PBKDF2 class. Example: Using security.PBKDF2 methods This example generates a key size of 128-bits based on a given password.