#NEWLINE# def recoverKey( ) : #NEWLINE# #INDENT# plaintext = ( b'A' * 48 ) #NEWLINE# cipher = aes_cbc_enc ( plaintext , global_aes_key , global_iv ) #NEWLINE# modifiedCipher = ( ( cipher [ 0 : 16 ] + ( b'\x00' * 16 ) ) + cipher [ 0 : 16 ] ) #NEWLINE# ( checkAsciiResult , errorString ) = decryptAndCheckAscii ( modifiedCipher ) #NEWLINE# if checkAsciiResult : #NEWLINE# #INDENT# raise Exception ( 'Unlucky' ) #NEWLINE# #UNINDENT# key = raw_xor ( errorString [ 0 : 16 ] , errorString [ 32 : 48 ] ) #NEWLINE# return key