OwlCyberSecurity - MANAGER
Edit File: randbytes.pyc
� `��ac @` s� d Z d d l m Z m Z d d l Z d d l Z d d l Z d d l Z d d l m Z e e d d � Z e r� e j Z n d � Z d e f d � � YZ d e f d � � YZ d e f d � � YZ e � Z e j Z e j Z [ d d d g Z d S( sQ Cryptographically secure random implementation, with fallback on normal random. i ( t divisiont absolute_importN( t _PY3t getrandbitsc C` s | j d � S( Nt hex( t decode( t hexBytes( ( s[ /opt/cpanel-ccs/.develop/virtualenv/lib/python2.7/site-packages/twisted/python/randbytes.pyt _fromhex s t SecureRandomNotAvailablec B` s e Z d Z RS( sD Exception raised when no secure random algorithm is found. ( t __name__t __module__t __doc__( ( ( s[ /opt/cpanel-ccs/.develop/virtualenv/lib/python2.7/site-packages/twisted/python/randbytes.pyR s t SourceNotAvailablec B` s e Z d Z RS( sQ Internal exception used when a specific random source is not available. ( R R R ( ( ( s[ /opt/cpanel-ccs/.develop/virtualenv/lib/python2.7/site-packages/twisted/python/randbytes.pyR s t RandomFactoryc B` s} e Z d Z d Z e Z d � Z e d � Z d � Z e rQ e j Z d � Z n e j Z d � Z e d d � Z d � Z RS( s� Factory providing L{secureRandom} and L{insecureRandom} methods. You shouldn't have to instantiate this class, use the module level functions instead: it is an implementation detail and could be removed or changed arbitrarily. c C` s= y t j | � SWn% t t f k r8 } t | � � n Xd S( sO Wrapper around C{os.urandom} that cleanly manage its absence. N( t ost urandomt AttributeErrort NotImplementedErrorR ( t selft nbytest e( ( s[ /opt/cpanel-ccs/.develop/virtualenv/lib/python2.7/site-packages/twisted/python/randbytes.pyt _osUrandom5 s c C` sa y | j | � SWn t k r$ n X| rQ t j d d t d d �| j | � St d � � d S( sk Return a number of secure random bytes. @param nbytes: number of bytes to generate. @type nbytes: C{int} @param fallback: Whether the function should fallback on non-secure random or not. Default to C{False}. @type fallback: C{bool} @return: a string of random bytes. @rtype: C{str} sP urandom unavailable - proceeding with non-cryptographically secure random sourcet categoryt stackleveli s! No secure random source availableN( R R t warningst warnt RuntimeWarningt insecureRandomR ( R R t fallback( ( s[ /opt/cpanel-ccs/.develop/virtualenv/lib/python2.7/site-packages/twisted/python/randbytes.pyt secureRandom? s c C` sN | j d k r>