BigBrotherBot v1.9.0
System Development Information for the BigBrotherBot project.

b3::lib::beaker::crypto::pbkdf2::PBKDF2 Class Reference

List of all members.

Public Member Functions

def __init__
def read
def hexread
def close

Public Attributes

 closed

Private Member Functions

def _pseudorandom
def __f
def _setup

Private Attributes

 __macmodule
 __digestmodule
 __buf
 __blockNum
 __passphrase
 __salt
 __iterations
 __prf

Detailed Description

PBKDF2.py : PKCS#5 v2.0 Password-Based Key Derivation

This implementation takes a passphrase and a salt (and optionally an
iteration count, a digest module, and a MAC module) and provides a
file-like object from which an arbitrarily-sized key can be read.

If the passphrase and/or salt are unicode objects, they are encoded as
UTF-8 before they are processed.

The idea behind PBKDF2 is to derive a cryptographic key from a
passphrase and a salt.

PBKDF2 may also be used as a strong salted password hash.  The
'crypt' function is provided for that purpose.

Remember: Keys generated using PBKDF2 are only as strong as the
passphrases they are derived from.

Constructor & Destructor Documentation

def b3::lib::beaker::crypto::pbkdf2::PBKDF2::__init__ (   self,
  passphrase,
  salt,
  iterations = 1000,
  digestmodule = SHA1,
  macmodule = HMAC 
)

Member Function Documentation

def b3::lib::beaker::crypto::pbkdf2::PBKDF2::__f (   self,
  i 
) [private]
def b3::lib::beaker::crypto::pbkdf2::PBKDF2::_pseudorandom (   self,
  key,
  msg 
) [private]
Pseudorandom function.  e.g. HMAC-SHA1
def b3::lib::beaker::crypto::pbkdf2::PBKDF2::_setup (   self,
  passphrase,
  salt,
  iterations,
  prf 
) [private]
def b3::lib::beaker::crypto::pbkdf2::PBKDF2::close (   self)
Close the stream.
def b3::lib::beaker::crypto::pbkdf2::PBKDF2::hexread (   self,
  octets 
)
Read the specified number of octets. Return them as hexadecimal.

Note that len(obj.hexread(n)) == 2*n.
def b3::lib::beaker::crypto::pbkdf2::PBKDF2::read (   self,
  bytes 
)
Read the specified number of key bytes.

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Properties