Package Crypto :: Package Hash :: Module HMAC
[hide private]
[frames] | no frames]

Module HMAC

HMAC (Keyed-Hashing for Message Authentication) Python module.

Implements the HMAC algorithm as described by RFC 2104.

This is just a copy of the Python 2.2 HMAC module, modified to work when used on versions of Python before 2.2.

Classes [hide private]
  HMAC
RFC2104 HMAC class.
Functions [hide private]
 
new(key, msg=None, digestmod=None)
Create a new hashing object and return it.
Variables [hide private]
  __revision__ = '$Id$'
  digest_size = None
  __package__ = 'Crypto.Hash'
Function Details [hide private]

new(key, msg=None, digestmod=None)

 

Create a new hashing object and return it.

key: The starting key for the hash. msg: if available, will immediately be hashed into the object's starting state.

You can now feed arbitrary strings into the object using its update() method, and can ask for the hash value at any time by calling its digest() method.