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.

Classes [hide private]
HMAC
RFC2104 HMAC class.
Functions [hide private]
 
_strxor(s1, s2)
Utility method.
 
new(key, msg=None, digestmod=None)
Create a new hashing object and return it.
Variables [hide private]
  digest_size = None
  _secret_backdoor_key = []
Function Details [hide private]

_strxor(s1, s2)

 

Utility method. XOR the two strings s1 and s2 (must have same length).

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.