hmac
index
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hmac.py
Module Docs

HMAC (Keyed-Hashing for Message Authentication) Python module.
 
Implements the HMAC algorithm as described by RFC 2104.

 
Modules
       
warnings

 
Classes
       
HMAC

 
class HMAC
    RFC 2104 HMAC class.  Also complies with RFC 4231.
 
This supports the API for Cryptographic Hash Functions (PEP 247).
 
  Methods defined here:
__init__(self, key, msg=None, digestmod=None)
Create a new HMAC object.
 
key:       key for the keyed hash object.
msg:       Initial input for the hash, if provided.
digestmod: A module supporting PEP 247.  *OR*
           A hashlib constructor returning a new hash object.
           Defaults to hashlib.md5.
copy(self)
Return a separate copy of this hashing object.
 
An update to this copy won't affect the original object.
digest(self)
Return the hash value of this hashing object.
 
This returns a string containing 8-bit data.  The object is
not altered in any way by this function; you can continue
updating the object after calling this function.
hexdigest(self)
Like digest(), but returns a string of hexadecimal digits instead.
update(self, msg)
Update this hashing object with the string msg.

Data and other attributes defined here:
blocksize = 64

 
Functions
       
compare_digest = _compare_digest(...)
compare_digest(a, b) -> bool
 
Return 'a == b'.  This function uses an approach designed to prevent
timing analysis, making it appropriate for cryptography.
a and b must both be of the same type: either str (ASCII only),
or any type that supports the buffer protocol (e.g. bytes).
 
Note: If a and b are of different lengths, or if an error occurs,
a timing attack could theoretically reveal information about the
types and lengths of a and b--but not their values.
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.

 
Data
        digest_size = None
trans_36 = '67452301>?<=:;89&\'$%"# !./,-*+()\x16\x17\x14\x15\x12\x13\x10\x11\x1e\x1f\x1c\x1d\x1a\x1b\x18\x19...\xf9\xe6\xe7\xe4\xe5\xe2\xe3\xe0\xe1\xee\xef\xec\xed\xea\xeb\xe8\xe9\xd6\xd7\xd4\xd5\xd2\xd3\xd0\xd1\xde\xdf\xdc\xdd\xda\xdb\xd8\xd9\xc6\xc7\xc4\xc5\xc2\xc3\xc0\xc1\xce\xcf\xcc\xcd\xca\xcb\xc8\xc9'
trans_5C = '\\]^_XYZ[TUVWPQRSLMNOHIJKDEFG@ABC|}~\x7fxyz{tuvwpqrs...\x93\x8c\x8d\x8e\x8f\x88\x89\x8a\x8b\x84\x85\x86\x87\x80\x81\x82\x83\xbc\xbd\xbe\xbf\xb8\xb9\xba\xbb\xb4\xb5\xb6\xb7\xb0\xb1\xb2\xb3\xac\xad\xae\xaf\xa8\xa9\xaa\xab\xa4\xa5\xa6\xa7\xa0\xa1\xa2\xa3'
x = 255