<s> """<STR_LIT>""" <EOL> from . cryptomath import * <EOL> from . tripledes import * <EOL> if m2cryptoLoaded : <EOL> def new ( key , mode , IV ) : <EOL> return OpenSSL_TripleDES ( key , mode , IV ) <EOL> class OpenSSL_TripleDES ( TripleDES ) : <EOL> def __init__ ( self , key , mode , IV ) : <EOL> TripleDES . __init__ ( self , key , mode , IV , "<STR_LIT>" ) <EOL> self . key = key <EOL> self . IV = IV <EOL> def _createContext ( self , encrypt ) : <EOL> context = m2 . cipher_ctx_new ( ) <EOL> cipherType = m2 . des_ede3_cbc ( ) <EOL> m2 . cipher_init ( context , cipherType , self . key , self . IV , encrypt ) <EOL> return context <EOL> def encrypt ( self , plaintext ) : <EOL> TripleDES . encrypt ( self , plaintext ) <EOL> context = self . _createContext ( <NUM_LIT:1> ) <EOL> ciphertext = m2 . cipher_update ( context , plaintext ) <EOL> m2 . cipher_ctx_free ( context ) <EOL> self . IV = ciphertext [ - self . block_size : ] <EOL> return bytearray ( ciphertext ) <EOL> def decrypt ( self , ciphertext ) : <EOL> TripleDES . decrypt ( self , ciphertext ) <EOL> context = self . _createContext ( <NUM_LIT:0> ) <EOL> plaintext = m2 . cipher_update ( context , ciphertext + ( '<STR_LIT>' * <NUM_LIT:16> ) ) <EOL> plaintext = plaintext [ : len ( ciphertext ) ] <EOL> m2 . cipher_ctx_free ( context ) <EOL> self . IV = ciphertext [ - self . block_size : ] <EOL> return bytearray ( plaintext ) </s>
