<s> """<STR_LIT>""" <EOL> from cryptomath import * <EOL> from AES import * <EOL> if cryptlibpyLoaded : <EOL> def new ( key , mode , IV ) : <EOL> return Cryptlib_AES ( key , mode , IV ) <EOL> class Cryptlib_AES ( AES ) : <EOL> def __init__ ( self , key , mode , IV ) : <EOL> AES . __init__ ( self , key , mode , IV , "<STR_LIT>" ) <EOL> self . context = cryptlib_py . cryptCreateContext ( cryptlib_py . CRYPT_UNUSED , cryptlib_py . CRYPT_ALGO_AES ) <EOL> cryptlib_py . cryptSetAttribute ( self . context , cryptlib_py . CRYPT_CTXINFO_MODE , cryptlib_py . CRYPT_MODE_CBC ) <EOL> cryptlib_py . cryptSetAttribute ( self . context , cryptlib_py . CRYPT_CTXINFO_KEYSIZE , len ( key ) ) <EOL> cryptlib_py . cryptSetAttributeString ( self . context , cryptlib_py . CRYPT_CTXINFO_KEY , key ) <EOL> cryptlib_py . cryptSetAttributeString ( self . context , cryptlib_py . CRYPT_CTXINFO_IV , IV ) <EOL> def __del__ ( self ) : <EOL> cryptlib_py . cryptDestroyContext ( self . context ) <EOL> def encrypt ( self , plaintext ) : <EOL> AES . encrypt ( self , plaintext ) <EOL> bytes = stringToBytes ( plaintext ) <EOL> cryptlib_py . cryptEncrypt ( self . context , bytes ) <EOL> return bytesToString ( bytes ) <EOL> def decrypt ( self , ciphertext ) : <EOL> AES . decrypt ( self , ciphertext ) <EOL> bytes = stringToBytes ( ciphertext ) <EOL> cryptlib_py . cryptDecrypt ( self . context , bytes ) <EOL> return bytesToString ( bytes ) </s>
