This file is part of the web2py Web Framework Copyrighted by Massimo
Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3
(http://www.gnu.org/licenses/lgpl.html)
This file specifically includes utilities for security.
|
AES_new(key,
IV=None)
Returns an AES cipher object and random IV if None specified |
source code
|
|
|
compare(a,
b)
compares two strings and not vulnerable to timing attacks |
source code
|
|
|
md5_hash(text)
Generate a md5 hash with the given text |
source code
|
|
|
simple_hash(text,
key='
' ,
salt='
' ,
digest_alg=' md5 ' )
Generates hash with the given text using the specified digest hashing
algorithm |
source code
|
|
|
get_digest(value)
Returns a hashlib digest algorithm from a string |
source code
|
|
|
|
|
secure_dumps(data,
encryption_key,
hash_key=None,
compression_level=None) |
source code
|
|
|
secure_loads(data,
encryption_key,
hash_key=None,
compression_level=None) |
source code
|
|
|
initialize_urandom()
This function and the web2py_uuid follow from the following
discussion:
http://groups.google.com/group/web2py-developers/browse_thread/thread/7fd5789a7da3f09 |
source code
|
|
|
fast_urandom16(urandom=[ ] ,
locker=<_RLock owner=None count=0>)
this is 4x faster than calling os.urandom(16) and prevents the
"too many files open" issue with concurrent access to
os.urandom() |
source code
|
|
|
web2py_uuid(ctokens=( 9717086711068788442, 6984105393121222892) )
This function follows from the following discussion:
http://groups.google.com/group/web2py-developers/browse_thread/thread/7fd5789a7da3f09 |
source code
|
|
|
|
|
|
|
getipaddrinfo(host)
Filter out non-IP and bad IP addresses from getaddrinfo |
source code
|
|