@staticmethod<EOL><INDENT>def _generate_key(pass_id, passphrases, salt, algorithm):<DEDENT>
if pass_id not in passphrases:<EOL><INDENT>raise Exception('<STR_LIT>' % pass_id)<EOL><DEDENT>passphrase = passphrases[pass_id]<EOL>if len(passphrase) < <NUM_LIT:32>:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>digestmod = EncryptedPickle._get_hashlib(algorithm['<STR_LIT>'])<EOL>encoder = PBKDF2(passphrase, salt,<EOL>iterations=algorithm['<STR_LIT>'],<EOL>digestmodule=digestmod)<EOL>return encoder.read(algorithm['<STR_LIT>'])<EOL>
Generate and return PBKDF2 key