from warnings import warn from beaker.crypto.pbkdf2 import PBKDF2, strxor from beaker.crypto.util import hmac, sha1, hmac_sha1, md5 from beaker import util keyLength = None if util.jython: try: from beaker.crypto.jcecrypto import getKeyLength, aesEncrypt keyLength = getKeyLength() except ImportError: pass else: try: from beaker.crypto.nsscrypto import getKeyLength, aesEncrypt, aesDecrypt keyLength = getKeyLength() except ImportError: try: from beaker.crypto.pycrypto import getKeyLength, aesEncrypt, aesDecrypt keyLength = getKeyLength() except ImportError: pass if not keyLength: has_aes = False else: has_aes = True if has_aes and keyLength < 32: