#NEWLINE# def test_tampered_data( self ) : #NEWLINE# #INDENT# regex = 'Failed authentication of the data' #NEWLINE# c = VECTOR [ 'ciphertext' ] #NEWLINE# c = ( ( c [ : ( - 2 ) ] + six . int2byte ( ( six . indexbytes ( c , ( - 2 ) ) ^ 25 ) ) ) + six . int2byte ( six . indexbytes ( c , ( - 1 ) ) ) ) #NEWLINE# self . assertRaisesRegexp ( TripleSecError , regex , ( lambda : triplesec . decrypt ( c , VECTOR [ 'key' ] ) ) )