<s> """<STR_LIT>""" <EOL> __author__ = "<STR_LIT>" <EOL> __author_email__ = "<STR_LIT>" <EOL> def readUntilWhitespace ( stream , maxchars = None ) : <EOL> txt = "<STR_LIT>" <EOL> while True : <EOL> tok = stream . read ( <NUM_LIT:1> ) <EOL> if tok . isspace ( ) or not tok : <EOL> break <EOL> txt += tok <EOL> if len ( txt ) == maxchars : <EOL> break <EOL> return txt <EOL> def readNonWhitespace ( stream ) : <EOL> tok = '<STR_LIT:U+0020>' <EOL> while tok == '<STR_LIT:\n>' or tok == '<STR_LIT:\r>' or tok == '<STR_LIT:U+0020>' or tok == '<STR_LIT:\t>' : <EOL> tok = stream . read ( <NUM_LIT:1> ) <EOL> return tok <EOL> class ConvertFunctionsToVirtualList ( object ) : <EOL> def __init__ ( self , lengthFunction , getFunction ) : <EOL> self . lengthFunction = lengthFunction <EOL> self . getFunction = getFunction <EOL> def __len__ ( self ) : <EOL> return self . lengthFunction ( ) <EOL> def __getitem__ ( self , index ) : <EOL> if not isinstance ( index , int ) : <EOL> raise TypeError , "<STR_LIT>" <EOL> len_self = len ( self ) <EOL> if index < <NUM_LIT:0> : <EOL> index = len_self + index <EOL> if index < <NUM_LIT:0> or index >= len_self : <EOL> raise IndexError , "<STR_LIT>" <EOL> return self . getFunction ( index ) <EOL> def RC4_encrypt ( key , plaintext ) : <EOL> S = [ i for i in range ( <NUM_LIT> ) ] <EOL> j = <NUM_LIT:0> <EOL> for i in range ( <NUM_LIT> ) : <EOL> j = ( j + S [ i ] + ord ( key [ i % len ( key ) ] ) ) % <NUM_LIT> <EOL> S [ i ] , S [ j ] = S [ j ] , S [ i ] <EOL> i , j = <NUM_LIT:0> , <NUM_LIT:0> <EOL> retval = "<STR_LIT>" <EOL> for x in range ( len ( plaintext ) ) : <EOL> i = ( i + <NUM_LIT:1> ) % <NUM_LIT> <EOL> j = ( j + S [ i ] ) % <NUM_LIT> <EOL> S [ i ] , S [ j ] = S [ j ] , S [ i ] <EOL> t = S [ ( S [ i ] + S [ j ] ) % <NUM_LIT> ] <EOL> retval += chr ( ord ( plaintext [ x ] ) ^ t ) <EOL> return retval <EOL> def matrixMultiply ( a , b ) : <EOL> return [ [ sum ( [ float ( i ) * float ( j ) <EOL> for i , j in zip ( row , col ) ] <EOL> ) for col in zip ( * b ) ] <EOL> for row in a ] <EOL> class PyPdfError ( Exception ) : <EOL> pass <EOL> class PdfReadError ( PyPdfError ) : <EOL> pass <EOL> class PageSizeNotDefinedError ( PyPdfError ) : <EOL> pass <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> out = RC4_encrypt ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> print repr ( out ) <EOL> pt = RC4_encrypt ( "<STR_LIT>" , out ) <EOL> print repr ( pt ) </s>
