Back to index

python3.2  3.2.2
Classes | Functions | Variables
hmac Namespace Reference

Classes

class  HMAC

Functions

def new

Variables

tuple trans_5C = bytes((x ^ 0x5C) for x in range(256))
tuple trans_36 = bytes((x ^ 0x36) for x in range(256))
 digest_size = None

Detailed Description

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

Implements the HMAC algorithm as described by RFC 2104.

Function Documentation

def hmac.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.

Definition at line 118 of file hmac.py.

00118 
00119 def new(key, msg = None, digestmod = None):
00120     """Create a new hashing object and return it.
00121 
00122     key: The starting key for the hash.
00123     msg: if available, will immediately be hashed into the object's starting
00124     state.
00125 
00126     You can now feed arbitrary strings into the object using its update()
00127     method, and can ask for the hash value at any time by calling its digest()
00128     method.
00129     """
00130     return HMAC(key, msg, digestmod)

Here is the caller graph for this function:


Variable Documentation

Definition at line 13 of file hmac.py.

tuple hmac.trans_36 = bytes((x ^ 0x36) for x in range(256))

Definition at line 9 of file hmac.py.

tuple hmac.trans_5C = bytes((x ^ 0x5C) for x in range(256))

Definition at line 8 of file hmac.py.